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~~~ 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~~~ 72scripts/rpc.py --help 73~~~ 74 75A detailed description of each RPC method and its parameters is also available. For example: 76 77~~~ 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~~~ 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~~~ 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~~~ 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~~~ 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~~~ 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~~~ 142from 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~~~ 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./scripts/config_converter.py < config.ini > config.json 219~~~ 220 221# App Framework {#jsonrpc_components_app} 222 223## spdk_kill_instance {#rpc_spdk_kill_instance} 224 225Send a signal to the application. 226 227### Parameters 228 229Name | Optional | Type | Description 230----------------------- | -------- | ----------- | ----------- 231sig_name | Required | string | Signal to send (SIGINT, SIGTERM, SIGQUIT, SIGHUP, or SIGKILL) 232 233### Example 234 235Example request: 236 237~~~ 238{ 239 "jsonrpc": "2.0", 240 "id": 1, 241 "method": "spdk_kill_instance", 242 "params": { 243 "sig_name": "SIGINT" 244 } 245} 246~~~ 247 248Example response: 249 250~~~ 251{ 252 "jsonrpc": "2.0", 253 "id": 1, 254 "result": true 255} 256~~~ 257 258## framework_monitor_context_switch {#rpc_framework_monitor_context_switch} 259 260Query, enable, or disable the context switch monitoring functionality. 261 262### Parameters 263 264Name | Optional | Type | Description 265----------------------- | -------- | ----------- | ----------- 266enabled | Optional | boolean | Enable (`true`) or disable (`false`) monitoring (omit this parameter to query the current state) 267 268### Response 269 270Name | Type | Description 271----------------------- | ----------- | ----------- 272enabled | boolean | The current state of context switch monitoring 273 274### Example 275 276Example request: 277 278~~~ 279{ 280 "jsonrpc": "2.0", 281 "id": 1, 282 "method": "framework_monitor_context_switch", 283 "params": { 284 "enabled": false 285 } 286} 287~~~ 288 289Example response: 290 291~~~ 292{ 293 "jsonrpc": "2.0", 294 "id": 1, 295 "result": { 296 "enabled": false 297 } 298} 299~~~ 300 301## framework_start_init {#rpc_framework_start_init} 302 303Start initialization of SPDK subsystems when it is deferred by starting SPDK application with option -w. 304During its deferral some RPCs can be used to set global parameters for SPDK subsystems. 305This RPC can be called only once. 306 307### Parameters 308 309This method has no parameters. 310 311### Response 312 313Completion status of SPDK subsystem initialization is returned as a boolean. 314 315### Example 316 317Example request: 318 319~~~ 320{ 321 "jsonrpc": "2.0", 322 "id": 1, 323 "method": "framework_start_init" 324} 325~~~ 326 327Example response: 328 329~~~ 330{ 331 "jsonrpc": "2.0", 332 "id": 1, 333 "result": true 334} 335~~~ 336 337## framework_wait_init {#rpc_framework_wait_init} 338 339Do not return until all subsystems have been initialized and the RPC system state is running. 340If the application is already running, this call will return immediately. This RPC can be called at any time. 341 342### Parameters 343 344This method has no parameters. 345 346### Response 347 348Returns True when subsystems have been initialized. 349 350### Example 351 352Example request: 353 354~~~ 355{ 356 "jsonrpc": "2.0", 357 "id": 1, 358 "method": "framework_wait_init" 359} 360~~~ 361 362Example response: 363 364~~~ 365{ 366 "jsonrpc": "2.0", 367 "id": 1, 368 "result": true 369} 370~~~ 371 372## rpc_get_methods {#rpc_rpc_get_methods} 373 374Get an array of supported RPC methods. 375 376### Parameters 377 378Name | Optional | Type | Description 379----------------------- | -------- | ----------- | ----------- 380current | Optional | boolean | Get an array of RPC methods only callable in the current state. 381 382### Response 383 384The response is an array of supported RPC methods. 385 386### Example 387 388Example request: 389 390~~~ 391{ 392 "jsonrpc": "2.0", 393 "id": 1, 394 "method": "rpc_get_methods" 395} 396~~~ 397 398Example response: 399 400~~~ 401{ 402 "jsonrpc": "2.0", 403 "id": 1, 404 "result": [ 405 "framework_start_init", 406 "rpc_get_methods", 407 "scsi_get_devices", 408 "net_get_interfaces", 409 "delete_ip_address", 410 "net_interface_add_ip_address", 411 "nbd_get_disks", 412 "nbd_stop_disk", 413 "nbd_start_disk", 414 "log_get_flags", 415 "log_clear_flag", 416 "log_set_flag", 417 "log_get_level", 418 "log_set_level", 419 "log_get_print_level", 420 "log_set_print_level", 421 "iscsi_get_options", 422 "iscsi_target_node_add_lun", 423 "iscsi_get_connections", 424 "iscsi_delete_portal_group", 425 "iscsi_create_portal_group", 426 "iscsi_get_portal_groups", 427 "iscsi_delete_target_node", 428 "iscsi_target_node_remove_pg_ig_maps", 429 "iscsi_target_node_add_pg_ig_maps", 430 "iscsi_create_target_node", 431 "iscsi_get_target_nodes", 432 "iscsi_delete_initiator_group", 433 "iscsi_initiator_group_remove_initiators", 434 "iscsi_initiator_group_add_initiators", 435 "iscsi_create_initiator_group", 436 "iscsi_get_initiator_groups", 437 "iscsi_set_options", 438 "bdev_set_options", 439 "bdev_set_qos_limit", 440 "bdev_get_bdevs", 441 "bdev_get_iostat", 442 "framework_get_config", 443 "framework_get_subsystems", 444 "framework_monitor_context_switch", 445 "spdk_kill_instance", 446 "ioat_scan_accel_engine", 447 "idxd_scan_accel_engine", 448 "bdev_virtio_attach_controller", 449 "bdev_virtio_scsi_get_devices", 450 "bdev_virtio_detach_controller", 451 "bdev_virtio_blk_set_hotplug", 452 "bdev_aio_delete", 453 "bdev_aio_create", 454 "bdev_split_delete", 455 "bdev_split_create", 456 "bdev_error_inject_error", 457 "bdev_error_delete", 458 "bdev_error_create", 459 "bdev_passthru_create", 460 "bdev_passthru_delete" 461 "bdev_nvme_apply_firmware", 462 "bdev_nvme_get_transport_statistics", 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_create", 470 "bdev_lvol_get_lvstores", 471 "bdev_lvol_delete", 472 "bdev_lvol_resize", 473 "bdev_lvol_set_read_only", 474 "bdev_lvol_decouple_parent", 475 "bdev_lvol_inflate", 476 "bdev_lvol_rename", 477 "bdev_lvol_clone", 478 "bdev_lvol_snapshot", 479 "bdev_lvol_create", 480 "bdev_lvol_delete_lvstore", 481 "bdev_lvol_rename_lvstore", 482 "bdev_lvol_create_lvstore" 483 ] 484} 485~~~ 486 487## framework_get_subsystems {#rpc_framework_get_subsystems} 488 489Get an array of name and dependency relationship of SPDK subsystems in initialization order. 490 491### Parameters 492 493None 494 495### Response 496 497The response is an array of name and dependency relationship of SPDK subsystems in initialization order. 498 499### Example 500 501Example request: 502 503~~~ 504{ 505 "jsonrpc": "2.0", 506 "id": 1, 507 "method": "framework_get_subsystems" 508} 509~~~ 510 511Example response: 512 513~~~ 514{ 515 "jsonrpc": "2.0", 516 "id": 1, 517 "result": [ 518 { 519 "subsystem": "accel", 520 "depends_on": [] 521 }, 522 { 523 "subsystem": "interface", 524 "depends_on": [] 525 }, 526 { 527 "subsystem": "net_framework", 528 "depends_on": [ 529 "interface" 530 ] 531 }, 532 { 533 "subsystem": "bdev", 534 "depends_on": [ 535 "accel" 536 ] 537 }, 538 { 539 "subsystem": "nbd", 540 "depends_on": [ 541 "bdev" 542 ] 543 }, 544 { 545 "subsystem": "nvmf", 546 "depends_on": [ 547 "bdev" 548 ] 549 }, 550 { 551 "subsystem": "scsi", 552 "depends_on": [ 553 "bdev" 554 ] 555 }, 556 { 557 "subsystem": "vhost", 558 "depends_on": [ 559 "scsi" 560 ] 561 }, 562 { 563 "subsystem": "iscsi", 564 "depends_on": [ 565 "scsi" 566 ] 567 } 568 ] 569} 570~~~ 571 572## framework_get_config {#rpc_framework_get_config} 573 574Get current configuration of the specified SPDK framework 575 576### Parameters 577 578Name | Optional | Type | Description 579----------------------- | -------- | ----------- | ----------- 580name | Required | string | SPDK subsystem name 581 582### Response 583 584The response is current configuration of the specified SPDK subsystem. 585Null is returned if it is not retrievable by the framework_get_config method and empty array is returned if it is empty. 586 587### Example 588 589Example request: 590 591~~~ 592{ 593 "jsonrpc": "2.0", 594 "id": 1, 595 "method": "framework_get_config", 596 "params": { 597 "name": "bdev" 598 } 599} 600~~~ 601 602Example response: 603 604~~~ 605{ 606 "jsonrpc": "2.0", 607 "id": 1, 608 "result": [ 609 { 610 "params": { 611 "base_bdev": "Malloc2", 612 "split_size_mb": 0, 613 "split_count": 2 614 }, 615 "method": "bdev_split_create" 616 }, 617 { 618 "params": { 619 "trtype": "PCIe", 620 "name": "Nvme1", 621 "traddr": "0000:01:00.0" 622 }, 623 "method": "bdev_nvme_attach_controller" 624 }, 625 { 626 "params": { 627 "trtype": "PCIe", 628 "name": "Nvme2", 629 "traddr": "0000:03:00.0" 630 }, 631 "method": "bdev_nvme_attach_controller" 632 }, 633 { 634 "params": { 635 "block_size": 512, 636 "num_blocks": 131072, 637 "name": "Malloc0", 638 "uuid": "913fc008-79a7-447f-b2c4-c73543638c31" 639 }, 640 "method": "bdev_malloc_create" 641 }, 642 { 643 "params": { 644 "block_size": 512, 645 "num_blocks": 131072, 646 "name": "Malloc1", 647 "uuid": "dd5b8f6e-b67a-4506-b606-7fff5a859920" 648 }, 649 "method": "bdev_malloc_create" 650 } 651 ] 652} 653~~~ 654 655## framework_get_reactors {#rpc_framework_get_reactors} 656 657Retrieve an array of all reactors. 658 659### Parameters 660 661This method has no parameters. 662 663### Response 664 665The response is an array of all reactors. 666 667### Example 668 669Example request: 670~~~ 671{ 672 "jsonrpc": "2.0", 673 "method": "framework_get_reactors", 674 "id": 1 675} 676~~~ 677 678Example response: 679~~~ 680{ 681 "jsonrpc": "2.0", 682 "id": 1, 683 "result": { 684 "tick_rate": 2400000000, 685 "reactors": [ 686 { 687 "lcore": 0, 688 "busy": 41289723495, 689 "idle": 3624832946, 690 "lw_threads": [ 691 { 692 "name": "app_thread", 693 "id", 1, 694 "cpumask": "1", 695 "elapsed": 44910853363 696 } 697 ] 698 } 699 ] 700 } 701} 702~~~ 703 704## framework_set_scheduler {#rpc_framework_set_scheduler} 705 706Select thread scheduler that will be activated. 707This feature is considered as experimental. 708 709### Parameters 710 711Name | Optional | Type | Description 712----------------------- | -------- | ----------- | ----------- 713name | Required | string | Name of a scheduler 714period | Optional | number | Scheduler period 715 716### Response 717 718Completion status of the operation is returned as a boolean. 719 720### Example 721 722Example request: 723 724~~~ 725{ 726 "jsonrpc": "2.0", 727 "method": "framework_set_scheduler", 728 "id": 1, 729 "params": { 730 "name": "static", 731 "period": "1000000" 732 } 733} 734~~~ 735 736Example response: 737 738~~~ 739{ 740 "jsonrpc": "2.0", 741 "id": 1, 742 "result": true 743} 744~~~ 745 746## framework_get_scheduler {#rpc_framework_get_scheduler} 747 748Retrieve currently set scheduler name and period, along with current governor name. 749 750### Parameters 751 752This method has no parameters. 753 754### Response 755 756Name | Description 757------------------------| ----------- 758scheduler_name | Current scheduler name 759scheduler_period | Currently set scheduler period in microseconds 760governor_name | Governor name 761 762### Example 763 764Example request: 765 766~~~ 767{ 768 "jsonrpc": "2.0", 769 "method": "framework_set_scheduler", 770 "id": 1, 771} 772~~~ 773 774Example response: 775 776~~~ 777{ 778 "jsonrpc": "2.0", 779 "id": 1, 780 "result": { 781 "scheduler_name": "static", 782 "scheduler_period": 2800000000, 783 "governor_name": "default" 784 } 785} 786~~~ 787 788## thread_get_stats {#rpc_thread_get_stats} 789 790Retrieve current statistics of all the threads. 791 792### Parameters 793 794This method has no parameters. 795 796### Response 797 798The response is an array of objects containing threads statistics. 799 800### Example 801 802Example request: 803~~~ 804{ 805 "jsonrpc": "2.0", 806 "method": "thread_get_stats", 807 "id": 1 808} 809~~~ 810 811Example response: 812~~~ 813{ 814 "jsonrpc": "2.0", 815 "id": 1, 816 "result": { 817 "tick_rate": 2400000000, 818 "threads": [ 819 { 820 "name": "app_thread", 821 "id": 1, 822 "cpumask": "1", 823 "busy": 139223208, 824 "idle": 8641080608, 825 "active_pollers_count": 1, 826 "timed_pollers_count": 2, 827 "paused_pollers_count": 0 828 } 829 ] 830 } 831} 832~~~ 833 834## thread_set_cpumask {#rpc_thread_set_cpumask} 835 836Set the cpumask of the thread to the specified value. The thread may be migrated 837to one of the specified CPUs. 838 839### Parameters 840 841Name | Optional | Type | Description 842----------------------- | -------- | ----------- | ----------- 843id | Required | string | Thread ID 844cpumask | Required | string | Cpumask for this thread 845 846### Response 847 848Completion status of the operation is returned as a boolean. 849 850### Example 851 852Example request: 853 854~~~ 855{ 856 "jsonrpc": "2.0", 857 "method": "thread_set_cpumask", 858 "id": 1, 859 "params": { 860 "id": "1", 861 "cpumask": "1" 862 } 863} 864~~~ 865 866Example response: 867 868~~~ 869{ 870 "jsonrpc": "2.0", 871 "id": 1, 872 "result": true 873} 874~~~ 875 876## trace_enable_tpoint_group {#rpc_trace_enable_tpoint_group} 877 878Enable trace on a specific tpoint group. For example "bdev" for bdev trace group, 879"all" for all trace groups. 880 881### Parameters 882 883Name | Optional | Type | Description 884----------------------- | -------- | ----------- | ----------- 885name | Required | string | bdev, nvmf_rdma, nvmf_tcp, blobfs, scsi, iscsi_conn, ftl, all 886 887### Example 888 889Example request: 890 891~~~ 892{ 893 "jsonrpc": "2.0", 894 "method": "trace_enable_tpoint_group", 895 "id": 1, 896 "params": { 897 "name": "bdev" 898 } 899} 900~~~ 901 902Example response: 903 904~~~ 905{ 906 "jsonrpc": "2.0", 907 "id": 1, 908 "result": true 909} 910~~~ 911 912## trace_disable_tpoint_group {#rpc_trace_disable_tpoint_group} 913 914Disable trace on a specific tpoint group. For example "bdev" for bdev trace group, 915"all" for all trace groups. 916 917### Parameters 918 919Name | Optional | Type | Description 920----------------------- | -------- | ----------- | ----------- 921name | Required | string | bdev, nvmf_rdma, nvmf_tcp, blobfs, all 922 923### Example 924 925Example request: 926 927~~~ 928{ 929 "jsonrpc": "2.0", 930 "method": "trace_disable_tpoint_group", 931 "id": 1, 932 "params": { 933 "name": "bdev" 934 } 935} 936~~~ 937 938Example response: 939 940~~~ 941{ 942 "jsonrpc": "2.0", 943 "id": 1, 944 "result": true 945} 946~~~ 947 948## trace_get_tpoint_group_mask {#rpc_trace_get_tpoint_group_mask} 949 950Display mask info for every group. 951 952### Parameters 953 954No parameters required 955 956### Example 957 958Example request: 959 960~~~ 961{ 962 "jsonrpc": "2.0", 963 "method": "trace_get_tpoint_group_mask", 964 "id": 1 965} 966~~~ 967 968Example response: 969 970~~~ 971{ 972 "jsonrpc": "2.0", 973 "id": 1, 974 "result": { 975 "tpoint_group_mask": "0x0", 976 "iscsi_conn": { 977 "enabled": false, 978 "mask": "0x2" 979 }, 980 "scsi": { 981 "enabled": false, 982 "mask": "0x4" 983 }, 984 "bdev": { 985 "enabled": false, 986 "mask": "0x8" 987 }, 988 "nvmf_tcp": { 989 "enabled": false, 990 "mask": "0x20" 991 }, 992 "ftl": { 993 "enabled": false, 994 "mask": "0x40" 995 }, 996 "blobfs": { 997 "enabled": false, 998 "mask": "0x80" 999 } 1000 } 1001} 1002~~~ 1003 1004## log_set_print_level {#rpc_log_set_print_level} 1005 1006Set the current level at which output will additionally be 1007sent to the current console. 1008 1009### Parameters 1010 1011Name | Optional | Type | Description 1012----------------------- | -------- | ----------- | ----------- 1013level | Required | string | ERROR, WARNING, NOTICE, INFO, DEBUG 1014 1015### Example 1016 1017Example request: 1018 1019~~~ 1020{ 1021 "jsonrpc": "2.0", 1022 "method": "log_set_print_level", 1023 "id": 1, 1024 "params": { 1025 "level": "ERROR" 1026 } 1027} 1028~~~ 1029 1030Example response: 1031 1032~~~ 1033{ 1034 "jsonrpc": "2.0", 1035 "id": 1, 1036 "result": true 1037} 1038~~~ 1039 1040## log_get_print_level {#rpc_log_get_print_level} 1041 1042Get the current level at which output will additionally be 1043sent to the current console. 1044 1045### Example 1046 1047Example request: 1048 1049~~~ 1050{ 1051 "jsonrpc": "2.0", 1052 "method": "log_get_print_level", 1053 "id": 1, 1054} 1055~~~ 1056 1057Example response: 1058 1059~~~ 1060{ 1061 "jsonrpc": "2.0", 1062 "id": 1, 1063 "result": "NOTICE" 1064} 1065~~~ 1066 1067## log_set_level {#rpc_log_set_level} 1068 1069Set the current logging level output by the `log` module. 1070 1071### Parameters 1072 1073Name | Optional | Type | Description 1074----------------------- | -------- | ----------- | ----------- 1075level | Required | string | ERROR, WARNING, NOTICE, INFO, DEBUG 1076 1077### Example 1078 1079Example request: 1080 1081~~~ 1082{ 1083 "jsonrpc": "2.0", 1084 "method": "log_set_level", 1085 "id": 1, 1086 "params": { 1087 "level": "ERROR" 1088 } 1089} 1090~~~ 1091 1092Example response: 1093 1094~~~ 1095{ 1096 "jsonrpc": "2.0", 1097 "id": 1, 1098 "result": true 1099} 1100~~~ 1101 1102## log_get_level {#rpc_log_get_level} 1103 1104Get the current logging level output by the `log` module. 1105 1106### Example 1107 1108Example request: 1109 1110~~~ 1111{ 1112 "jsonrpc": "2.0", 1113 "method": "log_get_level", 1114 "id": 1, 1115} 1116~~~ 1117 1118Example response: 1119 1120~~~ 1121{ 1122 "jsonrpc": "2.0", 1123 "id": 1, 1124 "result": "NOTICE" 1125} 1126~~~ 1127 1128## log_set_flag {#rpc_log_set_flag} 1129 1130Enable logging for specific portions of the application. The list of possible 1131log flags can be obtained using the `log_get_flags` RPC and may be different 1132for each application. 1133 1134### Parameters 1135 1136Name | Optional | Type | Description 1137----------------------- | -------- | ----------- | ----------- 1138flag | Required | string | A log flag, or 'all' 1139 1140### Example 1141 1142Example request: 1143 1144~~~ 1145{ 1146 "jsonrpc": "2.0", 1147 "method": "log_set_flag", 1148 "id": 1, 1149 "params": { 1150 "flag": "all" 1151 } 1152} 1153~~~ 1154 1155Example response: 1156 1157~~~ 1158{ 1159 "jsonrpc": "2.0", 1160 "id": 1, 1161 "result": true 1162} 1163~~~ 1164 1165## log_clear_flag {#rpc_log_clear_flag} 1166 1167Disable logging for specific portions of the application. The list of possible 1168log flags can be obtained using the `log_get_flags` RPC and may be different 1169for each application. 1170 1171### Parameters 1172 1173Name | Optional | Type | Description 1174----------------------- | -------- | ----------- | ----------- 1175flag | Required | string | A log flag, or 'all' 1176 1177### Example 1178 1179Example request: 1180 1181~~~ 1182{ 1183 "jsonrpc": "2.0", 1184 "method": "log_clear_flag", 1185 "id": 1, 1186 "params": { 1187 "flag": "all" 1188 } 1189} 1190~~~ 1191 1192Example response: 1193 1194~~~ 1195{ 1196 "jsonrpc": "2.0", 1197 "id": 1, 1198 "result": true 1199} 1200~~~ 1201 1202## log_get_flags {#rpc_log_get_flags} 1203 1204Get the list of valid flags for this application and whether 1205they are currently enabled. 1206 1207### Example 1208 1209Example request: 1210 1211~~~ 1212{ 1213 "jsonrpc": "2.0", 1214 "method": "log_get_flags", 1215 "id": 1, 1216} 1217~~~ 1218 1219Example response: 1220 1221~~~ 1222{ 1223 "jsonrpc": "2.0", 1224 "id": 1, 1225 "result": { 1226 "nvmf": true, 1227 "nvme": true, 1228 "aio": false, 1229 "bdev" false 1230 } 1231} 1232~~~ 1233 1234## log_enable_timestamps {#rpc_log_enable_timestamps} 1235 1236Enable or disable timestamps. 1237 1238### Parameters 1239 1240Name | Optional | Type | Description 1241----------------------- | -------- | ----------- | ----------- 1242enabled | Required | boolean | on or off 1243 1244### Example 1245 1246Example request: 1247 1248~~~ 1249{ 1250 "jsonrpc": "2.0", 1251 "method": "log_enable_timestamps", 1252 "id": 1, 1253 "params": { 1254 "enabled": true 1255 } 1256} 1257~~~ 1258 1259Example response: 1260 1261~~~ 1262{ 1263 "jsonrpc": "2.0", 1264 "id": 1, 1265 "result": true 1266} 1267~~~ 1268 1269## thread_get_pollers {#rpc_thread_get_pollers} 1270 1271Retrieve current pollers of all the threads. 1272 1273### Parameters 1274 1275This method has no parameters. 1276 1277### Response 1278 1279The response is an array of objects containing pollers of all the threads. 1280 1281### Example 1282 1283Example request: 1284~~~ 1285{ 1286 "jsonrpc": "2.0", 1287 "method": "thread_get_pollers", 1288 "id": 1 1289} 1290~~~ 1291 1292Example response: 1293~~~ 1294{ 1295 "jsonrpc": "2.0", 1296 "id": 1, 1297 "result": { 1298 "tick_rate": 2500000000, 1299 "threads": [ 1300 { 1301 "name": "app_thread", 1302 "id": 1, 1303 "active_pollers": [], 1304 "timed_pollers": [ 1305 { 1306 "name": "spdk_rpc_subsystem_poll", 1307 "state": "waiting", 1308 "run_count": 12345, 1309 "busy_count": 10000, 1310 "period_ticks": 10000000 1311 } 1312 ], 1313 "paused_pollers": [] 1314 } 1315 ] 1316 } 1317} 1318~~~ 1319 1320## thread_get_io_channels {#rpc_thread_get_io_channels} 1321 1322Retrieve current IO channels of all the threads. 1323 1324### Parameters 1325 1326This method has no parameters. 1327 1328### Response 1329 1330The response is an array of objects containing IO channels of all the threads. 1331 1332### Example 1333 1334Example request: 1335~~~ 1336{ 1337 "jsonrpc": "2.0", 1338 "method": "thread_get_io_channels", 1339 "id": 1 1340} 1341~~~ 1342 1343Example response: 1344~~~ 1345{ 1346 "jsonrpc": "2.0", 1347 "id": 1, 1348 "result": { 1349 "tick_rate": 2500000000, 1350 "threads": [ 1351 { 1352 "name": "app_thread", 1353 "io_channels": [ 1354 { 1355 "name": "nvmf_tgt", 1356 "ref": 1 1357 } 1358 ] 1359 } 1360 ] 1361 } 1362} 1363~~~ 1364 1365## env_dpdk_get_mem_stats {#rpc_env_dpdk_get_mem_stats} 1366 1367Write the dpdk memory stats to a file. 1368 1369### Parameters 1370 1371This method has no parameters. 1372 1373### Response 1374 1375The response is a pathname to a text file containing the memory stats. 1376 1377### Example 1378 1379Example request: 1380 1381~~~ 1382{ 1383 "jsonrpc": "2.0", 1384 "method": "env_dpdk_get_mem_stats", 1385 "id": 1 1386} 1387~~~ 1388 1389Example response: 1390 1391~~~ 1392{ 1393 "jsonrpc": "2.0", 1394 "id": 1, 1395 "result": { 1396 "filename": "/tmp/spdk_mem_dump.txt" 1397 } 1398} 1399~~~ 1400 1401# Acceleration Framework Layer {#jsonrpc_components_accel_fw} 1402 1403## idxd_scan_accel_engine {#rpc_idxd_scan_accel_engine} 1404 1405Set config and enable idxd accel engine offload. 1406This feature is considered as experimental. 1407 1408### Parameters 1409 1410Name | Optional | Type | Description 1411----------------------- | -------- | ----------- | ----------- 1412config_number | Required | number | Pre-defined config # to use (ie 0, 1). See [docs.](https://spdk.io/doc/idxd.html) 1413 1414### Example 1415 1416Example request: 1417 1418~~~ 1419{ 1420 "params": { 1421 "config_number": 0 1422 }, 1423 "jsonrpc": "2.0", 1424 "method": "idxd_scan_accel_engine", 1425 "id": 1 1426} 1427~~~ 1428 1429Example response: 1430 1431~~~ 1432{ 1433 "jsonrpc": "2.0", 1434 "id": 1, 1435 "result": true 1436} 1437~~~ 1438 1439## ioat_scan_accel_engine {#rpc_ioat_scan_accel_engine} 1440 1441Enable ioat accel engine offload. 1442 1443### Parameters 1444 1445None 1446 1447### Example 1448 1449Example request: 1450 1451~~~ 1452{ 1453 "jsonrpc": "2.0", 1454 "method": "ioat_scan_accel_engine", 1455 "id": 1 1456} 1457~~~ 1458 1459Example response: 1460 1461~~~ 1462{ 1463 "jsonrpc": "2.0", 1464 "id": 1, 1465 "result": true 1466} 1467~~~ 1468 1469# Block Device Abstraction Layer {#jsonrpc_components_bdev} 1470 1471## bdev_set_options {#rpc_bdev_set_options} 1472 1473Set global parameters for the block device (bdev) subsystem. This RPC may only be called 1474before SPDK subsystems have been initialized. 1475 1476### Parameters 1477 1478Name | Optional | Type | Description 1479----------------------- | -------- | ----------- | ----------- 1480bdev_io_pool_size | Optional | number | Number of spdk_bdev_io structures in shared buffer pool 1481bdev_io_cache_size | Optional | number | Maximum number of spdk_bdev_io structures cached per thread 1482bdev_auto_examine | Optional | boolean | If set to false, the bdev layer will not examine every disks automatically 1483 1484### Example 1485 1486Example request: 1487 1488~~~ 1489{ 1490 "jsonrpc": "2.0", 1491 "id": 1, 1492 "method": "bdev_set_options", 1493 "params": { 1494 "bdev_io_pool_size": 65536, 1495 "bdev_io_cache_size": 256 1496 } 1497} 1498~~~ 1499 1500Example response: 1501 1502~~~ 1503{ 1504 "jsonrpc": "2.0", 1505 "id": 1, 1506 "result": true 1507} 1508~~~ 1509 1510## bdev_get_bdevs {#rpc_bdev_get_bdevs} 1511 1512Get information about block devices (bdevs). 1513 1514### Parameters 1515 1516The user may specify no parameters in order to list all block devices, or a block device may be 1517specified by name. 1518 1519Name | Optional | Type | Description 1520----------------------- | -------- | ----------- | ----------- 1521name | Optional | string | Block device name 1522 1523### Response 1524 1525The response is an array of objects containing information about the requested block devices. 1526 1527### Example 1528 1529Example request: 1530 1531~~~ 1532{ 1533 "jsonrpc": "2.0", 1534 "id": 1, 1535 "method": "bdev_get_bdevs", 1536 "params": { 1537 "name": "Malloc0" 1538 } 1539} 1540~~~ 1541 1542Example response: 1543 1544~~~ 1545{ 1546 "jsonrpc": "2.0", 1547 "id": 1, 1548 "result": [ 1549 { 1550 "name": "Malloc0", 1551 "product_name": "Malloc disk", 1552 "block_size": 512, 1553 "num_blocks": 20480, 1554 "claimed": false, 1555 "zoned": false, 1556 "supported_io_types": { 1557 "read": true, 1558 "write": true, 1559 "unmap": true, 1560 "write_zeroes": true, 1561 "flush": true, 1562 "reset": true, 1563 "nvme_admin": false, 1564 "nvme_io": false 1565 }, 1566 "driver_specific": {} 1567 } 1568 ] 1569} 1570~~~ 1571 1572## bdev_examine {#rpc_bdev_examine} 1573 1574Request that the bdev layer examines the given bdev for metadata and creates 1575new bdevs if metadata is found. This is only necessary if `auto_examine` has 1576been set to false using `bdev_set_options`. By default, `auto_examine` is true 1577and bdev examination is automatic. 1578 1579### Parameters 1580 1581Name | Optional | Type | Description 1582----------------------- | -------- | ----------- | ----------- 1583name | Required | string | Block device name 1584 1585### Response 1586 1587The response is an array of objects containing I/O statistics of the requested block devices. 1588 1589### Example 1590 1591Example request: 1592 1593~~~ 1594{ 1595 "jsonrpc": "2.0", 1596 "id": 1, 1597 "method": "bdev_examine", 1598 "params": { 1599 "name": "Nvme0n1" 1600 } 1601} 1602~~~ 1603 1604Example response: 1605 1606~~~ 1607{ 1608 "jsonrpc": "2.0", 1609 "id": 1, 1610 "result": true 1611} 1612~~~ 1613 1614## bdev_wait_for_examine {#rpc_bdev_wait_for_examine} 1615 1616Report when all bdevs have been examined by every bdev module. 1617 1618### Parameters 1619 1620None 1621 1622### Response 1623 1624The response is sent when all bdev modules had a chance to examine every bdev. 1625 1626### Example 1627 1628Example request: 1629 1630~~~ 1631{ 1632 "jsonrpc": "2.0", 1633 "method": "bdev_wait_for_examine", 1634 "id": 1 1635} 1636~~~ 1637 1638Example response: 1639 1640~~~ 1641{ 1642 "jsonrpc": "2.0", 1643 "id": 1, 1644 "result": true 1645} 1646~~~ 1647 1648## bdev_get_iostat {#rpc_bdev_get_iostat} 1649 1650Get I/O statistics of block devices (bdevs). 1651 1652### Parameters 1653 1654The user may specify no parameters in order to list all block devices, or a block device may be 1655specified by name. 1656 1657Name | Optional | Type | Description 1658----------------------- | -------- | ----------- | ----------- 1659name | Optional | string | Block device name 1660 1661### Response 1662 1663The response is an array of objects containing I/O statistics of the requested block devices. 1664 1665### Example 1666 1667Example request: 1668 1669~~~ 1670{ 1671 "jsonrpc": "2.0", 1672 "id": 1, 1673 "method": "bdev_get_iostat", 1674 "params": { 1675 "name": "Nvme0n1" 1676 } 1677} 1678~~~ 1679 1680Example response: 1681 1682~~~ 1683{ 1684 "jsonrpc": "2.0", 1685 "id": 1, 1686 "result": { 1687 "tick_rate": 2200000000, 1688 "bdevs" : [ 1689 { 1690 "name": "Nvme0n1", 1691 "bytes_read": 36864, 1692 "num_read_ops": 2, 1693 "bytes_written": 0, 1694 "num_write_ops": 0, 1695 "bytes_unmapped": 0, 1696 "num_unmap_ops": 0, 1697 "read_latency_ticks": 178904, 1698 "write_latency_ticks": 0, 1699 "unmap_latency_ticks": 0, 1700 "queue_depth_polling_period": 2, 1701 "queue_depth": 0, 1702 "io_time": 0, 1703 "weighted_io_time": 0 1704 } 1705 ] 1706 } 1707} 1708~~~ 1709 1710## bdev_enable_histogram {#rpc_bdev_enable_histogram} 1711 1712Control whether collecting data for histogram is enabled for specified bdev. 1713 1714### Parameters 1715 1716Name | Optional | Type | Description 1717----------------------- | -------- | ----------- | ----------- 1718name | Required | string | Block device name 1719enable | Required | boolean | Enable or disable histogram on specified device 1720 1721### Example 1722 1723Example request: 1724 1725~~~ 1726{ 1727 "jsonrpc": "2.0", 1728 "id": 1, 1729 "method": "bdev_enable_histogram", 1730 "params": { 1731 "name": "Nvme0n1" 1732 "enable": true 1733 } 1734} 1735~~~ 1736 1737Example response: 1738 1739~~~ 1740{ 1741 "jsonrpc": "2.0", 1742 "id": 1, 1743 "result": true 1744} 1745~~~ 1746 1747## bdev_get_histogram {#rpc_bdev_get_histogram} 1748 1749Get latency histogram for specified bdev. 1750 1751### Parameters 1752 1753Name | Optional | Type | Description 1754----------------------- | -------- | ----------- | ----------- 1755name | Required | string | Block device name 1756 1757### Result 1758 1759Name | Description 1760------------------------| ----------- 1761histogram | Base64 encoded histogram 1762bucket_shift | Granularity of the histogram buckets 1763tsc_rate | Ticks per second 1764 1765### Example 1766 1767Example request: 1768 1769~~~ 1770{ 1771 "jsonrpc": "2.0", 1772 "id": 1, 1773 "method": "bdev_get_histogram", 1774 "params": { 1775 "name": "Nvme0n1" 1776 } 1777} 1778~~~ 1779 1780Example response: 1781Note that histogram field is trimmed, actual encoded histogram length is ~80kb. 1782 1783~~~ 1784{ 1785 "jsonrpc": "2.0", 1786 "id": 1, 1787 "result": { 1788 "histogram": "AAAAAAAAAAAAAA...AAAAAAAAA==", 1789 "tsc_rate": 2300000000, 1790 "bucket_shift": 7 1791 } 1792} 1793~~~ 1794 1795## bdev_set_qos_limit {#rpc_bdev_set_qos_limit} 1796 1797Set the quality of service rate limit on a bdev. 1798 1799### Parameters 1800 1801Name | Optional | Type | Description 1802----------------------- | -------- | ----------- | ----------- 1803name | Required | string | Block device name 1804rw_ios_per_sec | Optional | number | Number of R/W I/Os per second to allow. 0 means unlimited. 1805rw_mbytes_per_sec | Optional | number | Number of R/W megabytes per second to allow. 0 means unlimited. 1806r_mbytes_per_sec | Optional | number | Number of Read megabytes per second to allow. 0 means unlimited. 1807w_mbytes_per_sec | Optional | number | Number of Write megabytes per second to allow. 0 means unlimited. 1808 1809### Example 1810 1811Example request: 1812 1813~~~ 1814{ 1815 "jsonrpc": "2.0", 1816 "id": 1, 1817 "method": "bdev_set_qos_limit", 1818 "params": { 1819 "name": "Malloc0" 1820 "rw_ios_per_sec": 20000 1821 "rw_mbytes_per_sec": 100 1822 "r_mbytes_per_sec": 50 1823 "w_mbytes_per_sec": 50 1824 } 1825} 1826~~~ 1827 1828Example response: 1829 1830~~~ 1831{ 1832 "jsonrpc": "2.0", 1833 "id": 1, 1834 "result": true 1835} 1836~~~ 1837 1838## bdev_set_qd_sampling_period {#rpc_bdev_set_qd_sampling_period} 1839 1840Enable queue depth tracking on a specified bdev. 1841 1842### Parameters 1843 1844Name | Optional | Type | Description 1845----------------------- | -------- | ----------- | ----------- 1846name | Required | string | Block device name 1847period | Required | int | period (in microseconds).If set to 0, polling will be disabled. 1848 1849### Example 1850 1851Example request: 1852 1853~~~ 1854{ 1855 "jsonrpc": "2.0", 1856 "method": "bdev_set_qd_sampling_period", 1857 "id": 1, 1858 "params": { 1859 "name": "Malloc0", 1860 "period": 20 1861 } 1862} 1863~~~ 1864 1865Example response: 1866 1867~~~ 1868{ 1869 "jsonrpc": "2.0", 1870 "id": 1, 1871 "result": true 1872} 1873~~~ 1874 1875## bdev_compress_create {#rpc_bdev_compress_create} 1876 1877Create a new compress bdev on a given base bdev. 1878 1879### Parameters 1880 1881Name | Optional | Type | Description 1882----------------------- | -------- | ----------- | ----------- 1883base_bdev_name | Required | string | Name of the base bdev 1884pm_path | Required | string | Path to persistent memory 1885lb_size | Optional | int | Compressed vol logical block size (512 or 4096) 1886 1887### Result 1888 1889Name of newly created bdev. 1890 1891### Example 1892 1893Example request: 1894 1895~~~ 1896{ 1897 "params": { 1898 "base_bdev_name": "Nvme0n1", 1899 "pm_path": "/pm_files", 1900 "lb_size": 4096 1901 }, 1902 "jsonrpc": "2.0", 1903 "method": "bdev_compress_create", 1904 "id": 1 1905} 1906~~~ 1907 1908## bdev_compress_delete {#rpc_bdev_compress_delete} 1909 1910Delete a compressed bdev. 1911 1912### Parameters 1913 1914Name | Optional | Type | Description 1915----------------------- | -------- | ----------- | ----------- 1916name | Required | string | Name of the compress bdev 1917 1918### Example 1919 1920Example request: 1921 1922~~~ 1923{ 1924 "params": { 1925 "name": "COMP_Nvme0n1" 1926 }, 1927 "jsonrpc": "2.0", 1928 "method": "bdev_compress_delete", 1929 "id": 1 1930} 1931~~~ 1932 1933Example response: 1934 1935~~~ 1936{ 1937 "jsonrpc": "2.0", 1938 "id": 1, 1939 "result": true 1940} 1941~~~ 1942 1943## bdev_compress_get_orphans {#rpc_bdev_compress_get_orphans} 1944 1945Get a list of compressed volumes that are missing their pmem metadata. 1946 1947### Parameters 1948 1949Name | Optional | Type | Description 1950----------------------- | -------- | ----------- | ----------- 1951name | Required | string | Name of the compress bdev 1952 1953### Example 1954 1955Example request: 1956 1957~~~ 1958{ 1959 "params": { 1960 "name": "COMP_Nvme0n1" 1961 }, 1962 "jsonrpc": "2.0", 1963 "method": "bdev_compress_get_orphans", 1964 "id": 1 1965} 1966~~~ 1967 1968Example response: 1969 1970~~~ 1971{ 1972 "jsonrpc": "2.0", 1973 "id": 1, 1974 "name": "COMP_Nvme0n1" 1975} 1976~~~ 1977 1978## bdev_compress_set_pmd {#rpc_bdev_compress_set_pmd} 1979 1980Select the DPDK polled mode driver (pmd) for a compressed bdev, 19810 = auto-select, 1= QAT only, 2 = ISAL only. 1982 1983### Parameters 1984 1985Name | Optional | Type | Description 1986----------------------- | -------- | ----------- | ----------- 1987pmd | Required | int | pmd selection 1988 1989### Example 1990 1991Example request: 1992 1993~~~ 1994{ 1995 "params": { 1996 "pmd": 1 1997 }, 1998 "jsonrpc": "2.0", 1999 "method": "bdev_compress_set_pmd", 2000 "id": 1 2001} 2002~~~ 2003 2004Example response: 2005 2006~~~ 2007{ 2008 "jsonrpc": "2.0", 2009 "id": 1, 2010 "result": true 2011} 2012~~~ 2013 2014## bdev_crypto_create {#rpc_bdev_crypto_create} 2015 2016Create a new crypto bdev on a given base bdev. 2017 2018### Parameters 2019 2020Name | Optional | Type | Description 2021----------------------- | -------- | ----------- | ----------- 2022base_bdev_name | Required | string | Name of the base bdev 2023name | Required | string | Name of the crypto vbdev to create 2024crypto_pmd | Required | string | Name of the crypto device driver 2025key | Required | string | Key 2026cipher | Required | string | Cipher to use, AES_CBC or AES_XTS (QAT only) 2027key2 | Required | string | 2nd key only required for cipher AET_XTS 2028 2029### Result 2030 2031Name of newly created bdev. 2032 2033### Example 2034 2035Example request: 2036 2037~~~ 2038{ 2039 "params": { 2040 "base_bdev_name": "Nvme0n1", 2041 "name": "my_crypto_bdev", 2042 "crypto_pmd": "crypto_aesni_mb", 2043 "key": "1234567890123456", 2044 "cipher": "AES_CBC" 2045 }, 2046 "jsonrpc": "2.0", 2047 "method": "bdev_crypto_create", 2048 "id": 1 2049} 2050~~~ 2051 2052Example response: 2053 2054~~~ 2055{ 2056 2057 "jsonrpc": "2.0", 2058 "id": 1, 2059 "result": "my_crypto_bdev" 2060} 2061~~~ 2062 2063## bdev_crypto_delete {#rpc_bdev_crypto_delete} 2064 2065Delete a crypto bdev. 2066 2067### Parameters 2068 2069Name | Optional | Type | Description 2070----------------------- | -------- | ----------- | ----------- 2071name | Required | string | Name of the crypto bdev 2072 2073### Example 2074 2075Example request: 2076 2077~~~ 2078{ 2079 "params": { 2080 "name": "my_crypto_bdev" 2081 }, 2082 "jsonrpc": "2.0", 2083 "method": "bdev_crypto_delete", 2084 "id": 1 2085} 2086~~~ 2087 2088Example response: 2089 2090~~~ 2091{ 2092 "jsonrpc": "2.0", 2093 "id": 1, 2094 "result": true 2095} 2096~~~ 2097 2098## bdev_ocf_create {#rpc_bdev_ocf_create} 2099 2100Construct new OCF bdev. 2101Command accepts cache mode that is going to be used. 2102You can find more details about supported cache modes in the [OCF documentation](https://open-cas.github.io/cache_configuration.html#cache-mode) 2103 2104### Parameters 2105 2106Name | Optional | Type | Description 2107----------------------- | -------- | ----------- | ----------- 2108name | Required | string | Bdev name to use 2109mode | Required | string | OCF cache mode: wb, wt, pt, wa, wi, wo 2110cache_bdev_name | Required | string | Name of underlying cache bdev 2111core_bdev_name | Required | string | Name of underlying core bdev 2112 2113### Result 2114 2115Name of newly created bdev. 2116 2117### Example 2118 2119Example request: 2120 2121~~~ 2122{ 2123 "params": { 2124 "name": "ocf0", 2125 "mode": "wt", 2126 "cache_bdev_name": "Nvme0n1" 2127 "core_bdev_name": "aio0" 2128 }, 2129 "jsonrpc": "2.0", 2130 "method": "bdev_ocf_create", 2131 "id": 1 2132} 2133~~~ 2134 2135Example response: 2136 2137~~~ 2138{ 2139 "jsonrpc": "2.0", 2140 "id": 1, 2141 "result": "ocf0" 2142} 2143~~~ 2144 2145## bdev_ocf_delete {#rpc_bdev_ocf_delete} 2146 2147Delete the OCF bdev 2148 2149### Parameters 2150 2151Name | Optional | Type | Description 2152----------------------- | -------- | ----------- | ----------- 2153name | Required | string | Bdev name 2154 2155### Example 2156 2157Example request: 2158 2159~~~ 2160{ 2161 "params": { 2162 "name": "ocf0" 2163 }, 2164 "jsonrpc": "2.0", 2165 "method": "bdev_ocf_delete", 2166 "id": 1 2167} 2168~~~ 2169 2170Example response: 2171 2172~~~ 2173{ 2174 "jsonrpc": "2.0", 2175 "id": 1, 2176 "result": true 2177} 2178~~~ 2179 2180## bdev_ocf_get_stats {#rpc_bdev_ocf_get_stats} 2181 2182Get statistics of chosen OCF block device. 2183 2184### Parameters 2185 2186Name | Optional | Type | Description 2187----------------------- | -------- | ----------- | ----------- 2188name | Required | string | Block device name 2189 2190### Response 2191 2192Statistics as json object. 2193 2194### Example 2195 2196Example request: 2197 2198~~~ 2199{ 2200 "jsonrpc": "2.0", 2201 "method": "bdev_ocf_get_stats", 2202 "id": 1 2203} 2204~~~ 2205 2206Example response: 2207 2208~~~ 2209{ 2210 "jsonrpc": "2.0", 2211 "id": 1, 2212 "result": [ 2213 "usage": { 2214 "clean": { 2215 "count": 76033, 2216 "units": "4KiB blocks", 2217 "percentage": "100.0" 2218 }, 2219 "free": { 2220 "count": 767, 2221 "units": "4KiB blocks", 2222 "percentage": "0.9" 2223 }, 2224 "occupancy": { 2225 "count": 76033, 2226 "units": "4KiB blocks", 2227 "percentage": "99.0" 2228 }, 2229 "dirty": { 2230 "count": 0, 2231 "units": "4KiB blocks", 2232 "percentage": "0.0" 2233 } 2234 }, 2235 "requests": { 2236 "rd_total": { 2237 "count": 2, 2238 "units": "Requests", 2239 "percentage": "0.0" 2240 }, 2241 "wr_full_misses": { 2242 "count": 76280, 2243 "units": "Requests", 2244 "percentage": "35.6" 2245 }, 2246 "rd_full_misses": { 2247 "count": 1, 2248 "units": "Requests", 2249 "percentage": "0.0" 2250 }, 2251 "rd_partial_misses": { 2252 "count": 0, 2253 "units": "Requests", 2254 "percentage": "0.0" 2255 }, 2256 "wr_total": { 2257 "count": 212416, 2258 "units": "Requests", 2259 "percentage": "99.2" 2260 }, 2261 "wr_pt": { 2262 "count": 1535, 2263 "units": "Requests", 2264 "percentage": "0.7" 2265 }, 2266 "wr_partial_misses": { 2267 "count": 0, 2268 "units": "Requests", 2269 "percentage": "0.0" 2270 }, 2271 "serviced": { 2272 "count": 212418, 2273 "units": "Requests", 2274 "percentage": "99.2" 2275 }, 2276 "rd_pt": { 2277 "count": 0, 2278 "units": "Requests", 2279 "percentage": "0.0" 2280 }, 2281 "total": { 2282 "count": 213953, 2283 "units": "Requests", 2284 "percentage": "100.0" 2285 }, 2286 "rd_hits": { 2287 "count": 1, 2288 "units": "Requests", 2289 "percentage": "0.0" 2290 }, 2291 "wr_hits": { 2292 "count": 136136, 2293 "units": "Requests", 2294 "percentage": "63.6" 2295 } 2296 }, 2297 "errors": { 2298 "total": { 2299 "count": 0, 2300 "units": "Requests", 2301 "percentage": "0.0" 2302 }, 2303 "cache_obj_total": { 2304 "count": 0, 2305 "units": "Requests", 2306 "percentage": "0.0" 2307 }, 2308 "core_obj_total": { 2309 "count": 0, 2310 "units": "Requests", 2311 "percentage": "0.0" 2312 }, 2313 "cache_obj_rd": { 2314 "count": 0, 2315 "units": "Requests", 2316 "percentage": "0.0" 2317 }, 2318 "core_obj_wr": { 2319 "count": 0, 2320 "units": "Requests", 2321 "percentage": "0.0" 2322 }, 2323 "core_obj_rd": { 2324 "count": 0, 2325 "units": "Requests", 2326 "percentage": "0.0" 2327 }, 2328 "cache_obj_wr": { 2329 "count": 0, 2330 "units": "Requests", 2331 "percentage": "0.0" 2332 } 2333 }, 2334 "blocks": { 2335 "volume_rd": { 2336 "count": 9, 2337 "units": "4KiB blocks", 2338 "percentage": "0.0" 2339 }, 2340 "volume_wr": { 2341 "count": 213951, 2342 "units": "4KiB blocks", 2343 "percentage": "99.9" 2344 }, 2345 "cache_obj_total": { 2346 "count": 212425, 2347 "units": "4KiB blocks", 2348 "percentage": "100.0" 2349 }, 2350 "core_obj_total": { 2351 "count": 213959, 2352 "units": "4KiB blocks", 2353 "percentage": "100.0" 2354 }, 2355 "cache_obj_rd": { 2356 "count": 1, 2357 "units": "4KiB blocks", 2358 "percentage": "0.0" 2359 }, 2360 "core_obj_wr": { 2361 "count": 213951, 2362 "units": "4KiB blocks", 2363 "percentage": "99.9" 2364 }, 2365 "volume_total": { 2366 "count": 213960, 2367 "units": "4KiB blocks", 2368 "percentage": "100.0" 2369 }, 2370 "core_obj_rd": { 2371 "count": 8, 2372 "units": "4KiB blocks", 2373 "percentage": "0.0" 2374 }, 2375 "cache_obj_wr": { 2376 "count": 212424, 2377 "units": "4KiB blocks", 2378 "percentage": "99.9" 2379 } 2380 ] 2381} 2382~~~ 2383 2384## bdev_ocf_get_bdevs {#rpc_bdev_ocf_get_bdevs} 2385 2386Get list of OCF devices including unregistered ones. 2387 2388### Parameters 2389 2390Name | Optional | Type | Description 2391----------------------- | -------- | ----------- | ----------- 2392name | Optional | string | Name of OCF vbdev or name of cache device or name of core device 2393 2394### Response 2395 2396Array of OCF devices with their current status, along with core and cache bdevs. 2397 2398### Example 2399 2400Example request: 2401 2402~~~ 2403{ 2404 "jsonrpc": "2.0", 2405 "method": "bdev_ocf_get_bdevs", 2406 "id": 1 2407} 2408~~~ 2409 2410Example response: 2411 2412~~~ 2413{ 2414 "jsonrpc": "2.0", 2415 "id": 1, 2416 "result": [ 2417 { 2418 "name": "PartCache", 2419 "started": false, 2420 "cache": { 2421 "name": "Malloc0", 2422 "attached": true 2423 }, 2424 "core": { 2425 "name": "Malloc1", 2426 "attached": false 2427 } 2428 } 2429 ] 2430} 2431~~~ 2432 2433## bdev_ocf_set_cache_mode {#rpc_bdev_ocf_set_cache_mode} 2434 2435Set new cache mode on OCF bdev. 2436 2437### Parameters 2438 2439Name | Optional | Type | Description 2440----------------------- | -------- | ----------- | ----------- 2441name | Required | string | Bdev name 2442mode | Required | string | OCF cache mode: wb, wt, pt, wa, wi, wo 2443 2444### Response 2445 2446New cache mode name. 2447 2448### Example 2449 2450Example request: 2451 2452~~~ 2453{ 2454 "params": { 2455 "name": "ocf0", 2456 "mode": "pt", 2457 }, 2458 "jsonrpc": "2.0", 2459 "method": "bdev_ocf_set_cache_mode", 2460 "id": 1 2461} 2462~~~ 2463 2464Example response: 2465 2466~~~ 2467{ 2468 "jsonrpc": "2.0", 2469 "id": 1, 2470 "result": "pt" 2471} 2472~~~ 2473 2474## bdev_malloc_create {#rpc_bdev_malloc_create} 2475 2476Construct @ref bdev_config_malloc 2477 2478### Parameters 2479 2480Name | Optional | Type | Description 2481----------------------- | -------- | ----------- | ----------- 2482name | Optional | string | Bdev name to use 2483block_size | Required | number | Block size in bytes -must be multiple of 512 2484num_blocks | Required | number | Number of blocks 2485uuid | Optional | string | UUID of new bdev 2486 2487### Result 2488 2489Name of newly created bdev. 2490 2491### Example 2492 2493Example request: 2494 2495~~~ 2496{ 2497 "params": { 2498 "block_size": 4096, 2499 "num_blocks": 16384, 2500 "name": "Malloc0", 2501 "uuid": "2b6601ba-eada-44fb-9a83-a20eb9eb9e90" 2502 }, 2503 "jsonrpc": "2.0", 2504 "method": "bdev_malloc_create", 2505 "id": 1 2506} 2507~~~ 2508 2509Example response: 2510 2511~~~ 2512{ 2513 "jsonrpc": "2.0", 2514 "id": 1, 2515 "result": "Malloc0" 2516} 2517~~~ 2518 2519## bdev_malloc_delete {#rpc_bdev_malloc_delete} 2520 2521Delete @ref bdev_config_malloc 2522 2523### Parameters 2524 2525Name | Optional | Type | Description 2526----------------------- | -------- | ----------- | ----------- 2527name | Required | string | Bdev name 2528 2529### Example 2530 2531Example request: 2532 2533~~~ 2534{ 2535 "params": { 2536 "name": "Malloc0" 2537 }, 2538 "jsonrpc": "2.0", 2539 "method": "bdev_malloc_delete", 2540 "id": 1 2541} 2542~~~ 2543 2544Example response: 2545 2546~~~ 2547{ 2548 "jsonrpc": "2.0", 2549 "id": 1, 2550 "result": true 2551} 2552~~~ 2553 2554## bdev_null_create {#rpc_bdev_null_create} 2555 2556Construct @ref bdev_config_null 2557 2558### Parameters 2559 2560Name | Optional | Type | Description 2561----------------------- | -------- | ----------- | ----------- 2562name | Optional | string | Bdev name to use 2563block_size | Required | number | Block size in bytes 2564num_blocks | Required | number | Number of blocks 2565uuid | Optional | string | UUID of new bdev 2566md_size | Optional | number | Metadata size for this bdev. Default=0. 2567dif_type | Optional | number | Protection information type. Parameter --md-size needs to be set along --dif-type. Default=0 - no protection. 2568dif_is_head_of_md | Optional | boolean | Protection information is in the first 8 bytes of metadata. Default=false. 2569 2570### Result 2571 2572Name of newly created bdev. 2573 2574### Example 2575 2576Example request: 2577 2578~~~ 2579{ 2580 "params": { 2581 "block_size": 4104, 2582 "num_blocks": 16384, 2583 "name": "Null0", 2584 "uuid": "2b6601ba-eada-44fb-9a83-a20eb9eb9e90", 2585 "md_size": 8, 2586 "dif_type": 1, 2587 "dif_is_head_of_md": true 2588 }, 2589 "jsonrpc": "2.0", 2590 "method": "bdev_null_create", 2591 "id": 1 2592} 2593~~~ 2594 2595Example response: 2596 2597~~~ 2598{ 2599 "jsonrpc": "2.0", 2600 "id": 1, 2601 "result": "Null0" 2602} 2603~~~ 2604 2605## bdev_null_delete {#rpc_bdev_null_delete} 2606 2607Delete @ref bdev_config_null. 2608 2609### Parameters 2610 2611Name | Optional | Type | Description 2612----------------------- | -------- | ----------- | ----------- 2613name | Required | string | Bdev name 2614 2615### Example 2616 2617Example request: 2618 2619~~~ 2620{ 2621 "params": { 2622 "name": "Null0" 2623 }, 2624 "jsonrpc": "2.0", 2625 "method": "bdev_null_delete", 2626 "id": 1 2627} 2628~~~ 2629 2630Example response: 2631 2632~~~ 2633{ 2634 "jsonrpc": "2.0", 2635 "id": 1, 2636 "result": true 2637} 2638~~~ 2639 2640## bdev_null_resize {#rpc_bdev_null_resize} 2641 2642Resize @ref bdev_config_null. 2643 2644### Parameters 2645 2646Name | Optional | Type | Description 2647----------------------- | -------- | ----------- | ----------- 2648name | Required | string | Bdev name 2649new_size | Required | number | Bdev new capacity in MB 2650 2651### Example 2652 2653Example request: 2654 2655~~~ 2656{ 2657 "params": { 2658 "name": "Null0", 2659 "new_size": 4096 2660 }, 2661 "jsonrpc": "2.0", 2662 "method": "bdev_null_resize", 2663 "id": 1 2664} 2665~~~ 2666 2667Example response: 2668 2669~~~ 2670{ 2671 "jsonrpc": "2.0", 2672 "id": 1, 2673 "result": true 2674} 2675~~~ 2676 2677## bdev_aio_create {#rpc_bdev_aio_create} 2678 2679Construct @ref bdev_config_aio. 2680 2681### Parameters 2682 2683Name | Optional | Type | Description 2684----------------------- | -------- | ----------- | ----------- 2685name | Required | string | Bdev name to use 2686filename | Required | number | Path to device or file 2687block_size | Optional | number | Block size in bytes 2688 2689### Result 2690 2691Name of newly created bdev. 2692 2693### Example 2694 2695Example request: 2696 2697~~~ 2698{ 2699 "params": { 2700 "block_size": 4096, 2701 "name": "Aio0", 2702 "filename": "/tmp/aio_bdev_file" 2703 }, 2704 "jsonrpc": "2.0", 2705 "method": "bdev_aio_create", 2706 "id": 1 2707} 2708~~~ 2709 2710Example response: 2711 2712~~~ 2713{ 2714 "jsonrpc": "2.0", 2715 "id": 1, 2716 "result": "Aio0" 2717} 2718~~~ 2719 2720## bdev_aio_delete {#rpc_bdev_aio_delete} 2721 2722Delete @ref bdev_config_aio. 2723 2724### Parameters 2725 2726Name | Optional | Type | Description 2727----------------------- | -------- | ----------- | ----------- 2728name | Required | string | Bdev name 2729 2730### Example 2731 2732Example request: 2733 2734~~~ 2735{ 2736 "params": { 2737 "name": "Aio0" 2738 }, 2739 "jsonrpc": "2.0", 2740 "method": "bdev_aio_delete", 2741 "id": 1 2742} 2743~~~ 2744 2745Example response: 2746 2747~~~ 2748{ 2749 "jsonrpc": "2.0", 2750 "id": 1, 2751 "result": true 2752} 2753~~~ 2754 2755## bdev_nvme_set_options {#rpc_bdev_nvme_set_options} 2756 2757Set global parameters for all bdev NVMe. This RPC may only be called before SPDK subsystems have been initialized or any bdev NVMe has been created. 2758 2759### Parameters 2760 2761Name | Optional | Type | Description 2762-------------------------- | -------- | ----------- | ----------- 2763action_on_timeout | Optional | string | Action to take on command time out: none, reset or abort 2764timeout_us | Optional | number | Timeout for each command, in microseconds. If 0, don't track timeouts 2765keep_alive_timeout_ms | Optional | number | Keep alive timeout period in milliseconds, default is 10s 2766retry_count | Optional | number | The number of attempts per I/O before an I/O fails 2767arbitration_burst | Optional | number | The value is expressed as a power of two, a value of 111b indicates no limit 2768low_priority_weight | Optional | number | The maximum number of commands that the controller may launch at one time from a low priority queue 2769medium_priority_weight | Optional | number | The maximum number of commands that the controller may launch at one time from a medium priority queue 2770high_priority_weight | Optional | number | The maximum number of commands that the controller may launch at one time from a high priority queue 2771nvme_adminq_poll_period_us | Optional | number | How often the admin queue is polled for asynchronous events in microseconds 2772nvme_ioq_poll_period_us | Optional | number | How often I/O queues are polled for completions, in microseconds. Default: 0 (as fast as possible). 2773io_queue_requests | Optional | number | The number of requests allocated for each NVMe I/O queue. Default: 512. 2774delay_cmd_submit | Optional | boolean | Enable delaying NVMe command submission to allow batching of multiple commands. Default: `true`. 2775 2776### Example 2777 2778Example request: 2779 2780~~~ 2781request: 2782{ 2783 "params": { 2784 "retry_count": 5, 2785 "arbitration_burst": 3, 2786 "low_priority_weight": 8, 2787 "medium_priority_weight":8, 2788 "high_priority_weight": 8, 2789 "nvme_adminq_poll_period_us": 2000, 2790 "timeout_us": 10000000, 2791 "keep_alive_timeout_ms": 600000, 2792 "action_on_timeout": "reset", 2793 "io_queue_requests" : 2048, 2794 "delay_cmd_submit": true 2795 }, 2796 "jsonrpc": "2.0", 2797 "method": "bdev_nvme_set_options", 2798 "id": 1 2799} 2800~~~ 2801 2802Example response: 2803 2804~~~ 2805{ 2806 "jsonrpc": "2.0", 2807 "id": 1, 2808 "result": true 2809} 2810~~~ 2811 2812## bdev_nvme_set_hotplug {#rpc_bdev_nvme_set_hotplug} 2813 2814Change settings of the NVMe hotplug feature. If enabled, PCIe NVMe bdevs will be automatically discovered on insertion 2815and deleted on removal. 2816 2817### Parameters 2818 2819Name | Optional | Type | Description 2820----------------------- | -------- | ----------- | ----------- 2821enabled | Required | string | True to enable, false to disable 2822period_us | Optional | number | How often to poll for hot-insert and hot-remove events. Values: 0 - reset/use default or 1 to 10000000. 2823 2824### Example 2825 2826Example request: 2827 2828~~~ 2829request: 2830{ 2831 "params": { 2832 "enabled": true, 2833 "period_us": 2000 2834 }, 2835 "jsonrpc": "2.0", 2836 "method": "bdev_nvme_set_hotplug", 2837 "id": 1 2838} 2839~~~ 2840 2841Example response: 2842 2843~~~ 2844{ 2845 "jsonrpc": "2.0", 2846 "id": 1, 2847 "result": true 2848} 2849~~~ 2850 2851## bdev_nvme_attach_controller {#rpc_bdev_nvme_attach_controller} 2852 2853Construct @ref bdev_config_nvme. This RPC can also be used to add additional paths to an existing controller to enable 2854multipathing. This is done by specifying the `name` parameter as an existing controller. When adding an additional 2855path, the hostnqn, hostsvcid, hostaddr, prchk_reftag, and prchk_guard_arguments must not be specified and are assumed 2856to have the same value as the existing path. 2857 2858### Result 2859 2860Array of names of newly created bdevs. 2861 2862### Parameters 2863 2864Name | Optional | Type | Description 2865----------------------- | -------- | ----------- | ----------- 2866name | Required | string | Name of the NVMe controller, prefix for each bdev name 2867trtype | Required | string | NVMe-oF target trtype: rdma or pcie 2868traddr | Required | string | NVMe-oF target address: ip or BDF 2869adrfam | Optional | string | NVMe-oF target adrfam: ipv4, ipv6, ib, fc, intra_host 2870trsvcid | Optional | string | NVMe-oF target trsvcid: port number 2871subnqn | Optional | string | NVMe-oF target subnqn 2872hostnqn | Optional | string | NVMe-oF target hostnqn 2873hostaddr | Optional | string | NVMe-oF host address: ip address 2874hostsvcid | Optional | string | NVMe-oF host trsvcid: port number 2875prchk_reftag | Optional | bool | Enable checking of PI reference tag for I/O processing 2876prchk_guard | Optional | bool | Enable checking of PI guard for I/O processing 2877hdgst | Optional | bool | Enable TCP header digest 2878ddgst | Optional | bool | Enable TCP data digest 2879 2880### Example 2881 2882Example request: 2883 2884~~~ 2885{ 2886 "params": { 2887 "trtype": "pcie", 2888 "name": "Nvme0", 2889 "traddr": "0000:0a:00.0" 2890 }, 2891 "jsonrpc": "2.0", 2892 "method": "bdev_nvme_attach_controller", 2893 "id": 1 2894} 2895~~~ 2896 2897Example response: 2898 2899~~~ 2900{ 2901 "jsonrpc": "2.0", 2902 "id": 1, 2903 "result": [ 2904 "Nvme0n1" 2905 ] 2906} 2907~~~ 2908 2909## bdev_nvme_get_controllers {#rpc_bdev_nvme_get_controllers} 2910 2911Get information about NVMe controllers. 2912 2913### Parameters 2914 2915The user may specify no parameters in order to list all NVMe controllers, or one NVMe controller may be 2916specified by name. 2917 2918Name | Optional | Type | Description 2919----------------------- | -------- | ----------- | ----------- 2920name | Optional | string | NVMe controller name 2921 2922### Response 2923 2924The response is an array of objects containing information about the requested NVMe controllers. 2925 2926### Example 2927 2928Example request: 2929 2930~~~ 2931{ 2932 "jsonrpc": "2.0", 2933 "id": 1, 2934 "method": "bdev_nvme_get_controllers", 2935 "params": { 2936 "name": "Nvme0" 2937 } 2938} 2939~~~ 2940 2941Example response: 2942 2943~~~ 2944{ 2945 "jsonrpc": "2.0", 2946 "id": 1, 2947 "result": [ 2948 { 2949 "name": "Nvme0", 2950 "trid": { 2951 "trtype": "PCIe", 2952 "traddr": "0000:05:00.0" 2953 } 2954 } 2955 ] 2956} 2957~~~ 2958 2959## bdev_nvme_detach_controller {#rpc_bdev_nvme_detach_controller} 2960 2961Detach NVMe controller and delete any associated bdevs. Optionally, 2962If all of the transport ID options are specified, only remove that 2963transport path from the specified controller. If that is the only 2964available path for the controller, this will also result in the 2965controller being detached and the associated bdevs being deleted. 2966 2967returns true if the controller and bdevs were successfully destroyed 2968or the address was properly removed, false otherwise. 2969 2970### Parameters 2971 2972Name | Optional | Type | Description 2973----------------------- | -------- | ----------- | ----------- 2974name | Required | string | Controller name 2975trtype | Optional | string | NVMe-oF target trtype: rdma or tcp 2976traddr | Optional | string | NVMe-oF target address: ip or BDF 2977adrfam | Optional | string | NVMe-oF target adrfam: ipv4, ipv6, ib, fc, intra_host 2978trsvcid | Optional | string | NVMe-oF target trsvcid: port number 2979subnqn | Optional | string | NVMe-oF target subnqn 2980 2981### Example 2982 2983Example requests: 2984 2985~~~ 2986{ 2987 "params": { 2988 "name": "Nvme0" 2989 }, 2990 "jsonrpc": "2.0", 2991 "method": "bdev_nvme_detach_controller", 2992 "id": 1 2993} 2994~~~ 2995 2996Example response: 2997 2998~~~ 2999{ 3000 "jsonrpc": "2.0", 3001 "id": 1, 3002 "result": true 3003} 3004~~~ 3005 3006## bdev_nvme_cuse_register {#rpc_bdev_nvme_cuse_register} 3007 3008Register CUSE device on NVMe controller. 3009This feature is considered as experimental. 3010 3011### Parameters 3012 3013Name | Optional | Type | Description 3014----------------------- | -------- | ----------- | ----------- 3015name | Required | string | Name of the NVMe controller 3016dev_path | Required | string | Path to the CUSE controller device, e.g. spdk/nvme0 3017 3018### Example 3019 3020Example request: 3021 3022~~~ 3023{ 3024 "params": { 3025 "dev_path": "spdk/nvme0", 3026 "name": "Nvme0" 3027 }, 3028 "jsonrpc": "2.0", 3029 "method": "bdev_nvme_cuse_register", 3030 "id": 1 3031} 3032~~~ 3033 3034Example response: 3035 3036~~~ 3037{ 3038 "jsonrpc": "2.0", 3039 "id": 1, 3040 "result": true 3041} 3042~~~ 3043 3044## bdev_nvme_cuse_unregister {#rpc_bdev_nvme_cuse_unregister} 3045 3046Unregister CUSE device on NVMe controller. 3047This feature is considered as experimental. 3048 3049### Parameters 3050 3051Name | Optional | Type | Description 3052----------------------- | -------- | ----------- | ----------- 3053name | Required | string | Name of the NVMe controller 3054 3055### Example 3056 3057Example request: 3058 3059~~~ 3060{ 3061 "params": { 3062 "name": "Nvme0" 3063 }, 3064 "jsonrpc": "2.0", 3065 "method": "bdev_nvme_cuse_unregister", 3066 "id": 1 3067} 3068~~~ 3069 3070Example response: 3071 3072~~~ 3073{ 3074 "jsonrpc": "2.0", 3075 "id": 1, 3076 "result": true 3077} 3078~~~ 3079 3080## bdev_zone_block_create {#rpc_bdev_zone_block_create} 3081 3082Creates a virtual zone device on top of existing non-zoned bdev. 3083 3084### Parameters 3085 3086Name | Optional | Type | Description 3087----------------------- | -------- | ----------- | ----------- 3088name | Required | string | Name of the Zone device 3089base_bdev | Required | string | Name of the Base bdev 3090zone_capacity | Required | number | Zone capacity in blocks 3091optimal_open_zones | Required | number | Number of zones required to reach optimal write speed 3092 3093### Example 3094 3095Example request: 3096 3097~~~ 3098{ 3099 "jsonrpc": "2.0", 3100 "method": "bdev_zone_block_create", 3101 "id": 1, 3102 "params": { 3103 "name": "zone1", 3104 "base_bdev": "NVMe0n1", 3105 "zone_capacity": 4096, 3106 "optimal_open_zones": 32 3107 } 3108} 3109~~~ 3110 3111Example response: 3112 3113~~~ 3114{ 3115 "jsonrpc": "2.0", 3116 "id": 1, 3117 "result": "zone1" 3118} 3119~~~ 3120 3121## bdev_zone_block_delete {#rpc_bdev_zone_block_delete} 3122 3123Deletes a virtual zone device. 3124 3125### Parameters 3126 3127Name | Optional | Type | Description 3128----------------------- | -------- | ----------- | ----------- 3129name | Required | string | Name of the Zone device 3130 3131### Example 3132 3133Example request: 3134 3135~~~ 3136{ 3137 "jsonrpc": "2.0", 3138 "method": "bdev_zone_block_delete", 3139 "id": 1, 3140 "params": { 3141 "name": "zone1" 3142 } 3143} 3144~~~ 3145 3146Example response: 3147 3148~~~ 3149{ 3150 "jsonrpc": "2.0", 3151 "id": 1, 3152 "result": true 3153} 3154~~~ 3155 3156## bdev_nvme_apply_firmware {#rpc_bdev_nvme_apply_firmware} 3157 3158Download and commit firmware to NVMe device. 3159 3160### Parameters 3161 3162Name | Optional | Type | Description 3163----------------------- | -------- | ----------- | ----------- 3164filename | Required | string | filename of the firmware to download 3165bdev_name | Required | string | Name of the NVMe block device 3166 3167### Example 3168 3169Example request: 3170 3171~~~ 3172{ 3173 "jsonrpc": "2.0", 3174 "method": "bdev_nvme_apply_firmware", 3175 "id": 1, 3176 "params": { 3177 "filename": "firmware_file", 3178 "bdev_name": "NVMe0n1" 3179 } 3180} 3181~~~ 3182 3183## bdev_nvme_get_transport_statistics {#rpc_bdev_nvme_get_transport_statistics} 3184 3185Get bdev_nvme poll group transport statistics. 3186 3187### Parameters 3188 3189This RPC method accepts no parameters 3190 3191### Response 3192 3193The response is an array of objects containing information about transport statistics per NVME poll group. 3194 3195### Example 3196 3197Example request: 3198 3199~~~ 3200{ 3201 "jsonrpc": "2.0", 3202 "id": 1, 3203 "method": "bdev_nvme_get_transport_statistics", 3204} 3205~~~ 3206 3207Example response: 3208 3209~~~ 3210{ 3211 "jsonrpc": "2.0", 3212 "id": 1, 3213 "result": { 3214 "poll_groups": [ 3215 { 3216 "thread": "nvmf_tgt_poll_group_0", 3217 "transports": [ 3218 { 3219 "trname": "RDMA", 3220 "devices": [ 3221 { 3222 "dev_name": "mlx5_1", 3223 "polls": 137492169, 3224 "idle_polls": 137492169, 3225 "completions": 0, 3226 "queued_requests": 0, 3227 "total_send_wrs": 0, 3228 "send_sq_doorbell_updates": 0, 3229 "total_recv_wrs": 0, 3230 "recv_sq_doorbell_updates": 0 3231 }, 3232 { 3233 "dev_name": "mlx5_0", 3234 "polls": 137985185, 3235 "idle_polls": 137492169, 3236 "completions": 1474593, 3237 "queued_requests": 0, 3238 "total_send_wrs": 1474593, 3239 "send_sq_doorbell_updates": 426147, 3240 "total_recv_wrs": 1474721, 3241 "recv_sq_doorbell_updates": 348445 3242 } 3243 ] 3244 }, 3245 { 3246 "trname": "PCIE", 3247 "polls": 435419831, 3248 "idle_polls": 434901004, 3249 "completions": 1485543, 3250 "cq_doorbell_updates": 518827, 3251 "queued_requests": 0, 3252 "submitted_requests": 1485543, 3253 "sq_doobell_updates": 516081 3254 } 3255 ] 3256 }, 3257 { 3258 "thread": "nvmf_tgt_poll_group_1", 3259 "transports": [ 3260 { 3261 "trname": "RDMA", 3262 "devices": [ 3263 { 3264 "dev_name": "mlx5_1", 3265 "polls": 140245630, 3266 "idle_polls": 140245630, 3267 "completions": 0, 3268 "queued_requests": 0, 3269 "total_send_wrs": 0, 3270 "send_sq_doorbell_updates": 0, 3271 "total_recv_wrs": 0, 3272 "recv_sq_doorbell_updates": 0 3273 }, 3274 { 3275 "dev_name": "mlx5_0", 3276 "polls": 140751844, 3277 "idle_polls": 140245630, 3278 "completions": 1489298, 3279 "queued_requests": 0, 3280 "total_send_wrs": 1489298, 3281 "send_sq_doorbell_updates": 433510, 3282 "total_recv_wrs": 1489426, 3283 "recv_sq_doorbell_updates": 357956 3284 } 3285 ] 3286 }, 3287 { 3288 "trname": "PCIE", 3289 "polls": 429044294, 3290 "idle_polls": 428525658, 3291 "completions": 1478730, 3292 "cq_doorbell_updates": 518636, 3293 "queued_requests": 0, 3294 "submitted_requests": 1478730, 3295 "sq_doobell_updates": 511658 3296 } 3297 ] 3298 } 3299 ] 3300 } 3301} 3302~~~ 3303 3304## bdev_rbd_create {#rpc_bdev_rbd_create} 3305 3306Create @ref bdev_config_rbd bdev 3307 3308This method is available only if SPDK was build with Ceph RBD support. 3309 3310### Parameters 3311 3312Name | Optional | Type | Description 3313----------------------- | -------- | ----------- | ----------- 3314name | Optional | string | Bdev name 3315user_id | Optional | string | Ceph ID (i.e. admin, not client.admin) 3316pool_name | Required | string | Pool name 3317rbd_name | Required | string | Image name 3318block_size | Required | number | Block size 3319config | Optional | string map | Explicit librados configuration 3320 3321If no config is specified, Ceph configuration files must exist with 3322all relevant settings for accessing the pool. If a config map is 3323passed, the configuration files are ignored and instead all key/value 3324pairs are passed to rados_conf_set to configure cluster access. In 3325practice, "mon_host" (= list of monitor address+port) and "key" (= the 3326secret key stored in Ceph keyrings) are enough. 3327 3328When accessing the image as some user other than "admin" (the 3329default), the "user_id" has to be set. 3330 3331### Result 3332 3333Name of newly created bdev. 3334 3335### Example 3336 3337Example request with `key` from `/etc/ceph/ceph.client.admin.keyring`: 3338 3339~~~ 3340{ 3341 "params": { 3342 "pool_name": "rbd", 3343 "rbd_name": "foo", 3344 "config": { 3345 "mon_host": "192.168.7.1:6789,192.168.7.2:6789", 3346 "key": "AQDwf8db7zR1GRAA5k7NKXjS5S5V4mntwUDnGQ==", 3347 } 3348 "block_size": 4096 3349 }, 3350 "jsonrpc": "2.0", 3351 "method": "bdev_rbd_create", 3352 "id": 1 3353} 3354~~~ 3355 3356Example response: 3357 3358~~~ 3359response: 3360{ 3361 "jsonrpc": "2.0", 3362 "id": 1, 3363 "result": "Ceph0" 3364} 3365~~~ 3366 3367## bdev_rbd_delete {#rpc_bdev_rbd_delete} 3368 3369Delete @ref bdev_config_rbd bdev 3370 3371This method is available only if SPDK was build with Ceph RBD support. 3372 3373### Result 3374 3375`true` if bdev with provided name was deleted or `false` otherwise. 3376 3377### Parameters 3378 3379Name | Optional | Type | Description 3380----------------------- | -------- | ----------- | ----------- 3381name | Required | string | Bdev name 3382 3383### Example 3384 3385Example request: 3386 3387~~~ 3388{ 3389 "params": { 3390 "name": "Rbd0" 3391 }, 3392 "jsonrpc": "2.0", 3393 "method": "bdev_rbd_delete", 3394 "id": 1 3395} 3396~~~ 3397 3398Example response: 3399 3400~~~ 3401{ 3402 "jsonrpc": "2.0", 3403 "id": 1, 3404 "result": true 3405} 3406~~~ 3407 3408## bdev_rbd_resize {#rpc_bdev_rbd_resize} 3409 3410Resize @ref bdev_config_rbd bdev 3411 3412This method is available only if SPDK was build with Ceph RBD support. 3413 3414### Result 3415 3416`true` if bdev with provided name was resized or `false` otherwise. 3417 3418### Parameters 3419 3420Name | Optional | Type | Description 3421----------------------- | -------- | ----------- | ----------- 3422name | Required | string | Bdev name 3423new_size | Required | int | New bdev size for resize operation in MiB 3424 3425### Example 3426 3427Example request: 3428 3429~~~ 3430{ 3431 "params": { 3432 "name": "Rbd0" 3433 "new_size": "4096" 3434 }, 3435 "jsonrpc": "2.0", 3436 "method": "bdev_rbd_resize", 3437 "id": 1 3438} 3439~~~ 3440 3441Example response: 3442 3443~~~ 3444{ 3445 "jsonrpc": "2.0", 3446 "id": 1, 3447 "result": true 3448} 3449~~~ 3450 3451## bdev_delay_create {#rpc_bdev_delay_create} 3452 3453Create delay bdev. This bdev type redirects all IO to it's base bdev and inserts a delay on the completion 3454path to create an artificial drive latency. All latency values supplied to this bdev should be in microseconds. 3455 3456### Parameters 3457 3458Name | Optional | Type | Description 3459----------------------- | -------- | ----------- | ----------- 3460name | Required | string | Bdev name 3461base_bdev_name | Required | string | Base bdev name 3462avg_read_latency | Required | number | average read latency (us) 3463p99_read_latency | Required | number | p99 read latency (us) 3464avg_write_latency | Required | number | average write latency (us) 3465p99_write_latency | Required | number | p99 write latency (us) 3466 3467### Result 3468 3469Name of newly created bdev. 3470 3471### Example 3472 3473Example request: 3474 3475~~~ 3476{ 3477 "params": { 3478 "base_bdev_name": "Null0", 3479 "name": "Delay0", 3480 "avg_read_latency": "15", 3481 "p99_read_latency": "50", 3482 "avg_write_latency": "40", 3483 "p99_write_latency": "110", 3484 }, 3485 "jsonrpc": "2.0", 3486 "method": "bdev_delay_create", 3487 "id": 1 3488} 3489~~~ 3490 3491Example response: 3492 3493~~~ 3494{ 3495 "jsonrpc": "2.0", 3496 "id": 1, 3497 "result": "Delay0" 3498} 3499~~~ 3500 3501## bdev_delay_delete {#rpc_bdev_delay_delete} 3502 3503Delete delay bdev. 3504 3505### Parameters 3506 3507Name | Optional | Type | Description 3508----------------------- | -------- | ----------- | ----------- 3509name | Required | string | Bdev name 3510 3511### Example 3512 3513Example request: 3514 3515~~~ 3516{ 3517 "params": { 3518 "name": "Delay0" 3519 }, 3520 "jsonrpc": "2.0", 3521 "method": "bdev_delay_delete", 3522 "id": 1 3523} 3524 3525~~~ 3526 3527Example response: 3528 3529~~~ 3530{ 3531 "jsonrpc": "2.0", 3532 "id": 1, 3533 "result": true 3534} 3535~~~ 3536 3537## bdev_delay_update_latency {#rpc_bdev_delay_update_latency} 3538 3539Update a target latency value associated with a given delay bdev. Any currently 3540outstanding I/O will be completed with the old latency. 3541 3542### Parameters 3543 3544Name | Optional | Type | Description 3545----------------------- | -------- | ----------- | ----------- 3546delay_bdev_name | Required | string | Name of the delay bdev 3547latency_type | Required | string | One of: avg_read, avg_write, p99_read, p99_write 3548latency_us | Required | number | The new latency value in microseconds 3549 3550### Result 3551 3552Name of newly created bdev. 3553 3554### Example 3555 3556Example request: 3557 3558~~~ 3559{ 3560 "params": { 3561 "delay_bdev_name": "Delay0", 3562 "latency_type": "avg_read", 3563 "latency_us": "100", 3564 }, 3565 "jsonrpc": "2.0", 3566 "method": "bdev_delay_update_latency", 3567 "id": 1 3568} 3569~~~ 3570 3571Example response: 3572 3573~~~ 3574{ 3575 "result": "true" 3576} 3577~~~ 3578 3579## bdev_error_create {#rpc_bdev_error_create} 3580 3581Construct error bdev. 3582 3583### Parameters 3584 3585Name | Optional | Type | Description 3586----------------------- | -------- | ----------- | ----------- 3587base_name | Required | string | Base bdev name 3588 3589### Example 3590 3591Example request: 3592 3593~~~ 3594{ 3595 "params": { 3596 "base_name": "Malloc0" 3597 }, 3598 "jsonrpc": "2.0", 3599 "method": "bdev_error_create", 3600 "id": 1 3601} 3602~~~ 3603 3604Example response: 3605 3606~~~ 3607{ 3608 "jsonrpc": "2.0", 3609 "id": 1, 3610 "result": true 3611} 3612~~~ 3613 3614## bdev_error_delete {#rpc_bdev_error_delete} 3615 3616Delete error bdev 3617 3618### Result 3619 3620`true` if bdev with provided name was deleted or `false` otherwise. 3621 3622### Parameters 3623 3624Name | Optional | Type | Description 3625----------------------- | -------- | ----------- | ----------- 3626name | Required | string | Error bdev name 3627 3628### Example 3629 3630Example request: 3631 3632~~~ 3633{ 3634 "params": { 3635 "name": "EE_Malloc0" 3636 }, 3637 "jsonrpc": "2.0", 3638 "method": "bdev_error_delete", 3639 "id": 1 3640} 3641~~~ 3642 3643Example response: 3644 3645~~~ 3646{ 3647 "jsonrpc": "2.0", 3648 "id": 1, 3649 "result": true 3650} 3651~~~ 3652 3653## bdev_error_inject_error {#rpc_bdev_error_inject_error} 3654 3655Inject an error via an error bdev. Create an error bdev on base bdev first. Default 'num' 3656value is 1 and if 'num' is set to zero, the specified injection is disabled. 3657 3658### Parameters 3659 3660Name | Optional | Type | Description 3661----------------------- | -------- | ----------- | ----------- 3662name | Required | string | Name of the error injection bdev 3663io_type | Required | string | io type 'clear' 'read' 'write' 'unmap' 'flush' 'all' 3664error_type | Required | string | error type 'failure' 'pending' 3665num | Optional | int | the number of commands you want to fail.(default:1) 3666 3667### Example 3668 3669Example request: 3670 3671~~~ 3672{ 3673 "jsonrpc": "2.0", 3674 "method": "bdev_error_inject_error", 3675 "id": 1, 3676 "params": { 3677 "name": "EE_Malloc0", 3678 "io_type": "write", 3679 "error_type": "pending", 3680 "num": 1 3681 } 3682} 3683~~~ 3684 3685Example response: 3686 3687~~~ 3688{ 3689 "jsonrpc": "2.0", 3690 "id": 1, 3691 "result": true 3692} 3693~~~ 3694 3695## bdev_iscsi_create {#rpc_bdev_iscsi_create} 3696 3697Connect to iSCSI target and create bdev backed by this connection. 3698 3699This method is available only if SPDK was build with iSCSI initiator support. 3700 3701### Parameters 3702 3703Name | Optional | Type | Description 3704----------------------- | -------- | ----------- | ----------- 3705name | Required | string | Bdev name 3706initiator_iqn | Required | string | IQN name used during connection 3707url | Required | string | iSCSI resource URI 3708 3709### Result 3710 3711Name of newly created bdev. 3712 3713### Example 3714 3715Example request: 3716 3717~~~ 3718{ 3719 "params": { 3720 "url": "iscsi://127.0.0.1/iqn.2016-06.io.spdk:disk1/0", 3721 "initiator_iqn": "iqn.2016-06.io.spdk:init", 3722 "name": "iSCSI0" 3723 }, 3724 "jsonrpc": "2.0", 3725 "method": "bdev_iscsi_create", 3726 "id": 1 3727} 3728~~~ 3729 3730Example response: 3731 3732~~~ 3733{ 3734 "jsonrpc": "2.0", 3735 "id": 1, 3736 "result": "iSCSI0" 3737} 3738~~~ 3739 3740## bdev_iscsi_delete {#rpc_bdev_iscsi_delete} 3741 3742Delete iSCSI bdev and terminate connection to target. 3743 3744This method is available only if SPDK was built with iSCSI initiator support. 3745 3746### Parameters 3747 3748Name | Optional | Type | Description 3749----------------------- | -------- | ----------- | ----------- 3750name | Required | string | Bdev name 3751 3752### Example 3753 3754Example request: 3755 3756~~~ 3757{ 3758 "params": { 3759 "name": "iSCSI0" 3760 }, 3761 "jsonrpc": "2.0", 3762 "method": "bdev_iscsi_delete", 3763 "id": 1 3764} 3765~~~ 3766 3767Example response: 3768 3769~~~ 3770{ 3771 "jsonrpc": "2.0", 3772 "id": 1, 3773 "result": true 3774} 3775~~~ 3776 3777## bdev_ftl_create {#rpc_bdev_ftl_create} 3778 3779Create FTL bdev. 3780 3781This RPC is subject to change. 3782 3783### Parameters 3784 3785Name | Optional | Type | Description 3786----------------------- | -------- | ----------- | ----------- 3787name | Required | string | Bdev name 3788trtype | Required | string | Transport type 3789traddr | Required | string | NVMe target address 3790punits | Required | string | Parallel unit range in the form of start-end e.g 4-8 3791uuid | Optional | string | UUID of restored bdev (not applicable when creating new instance) 3792cache | Optional | string | Name of the bdev to be used as a write buffer cache 3793 3794### Result 3795 3796Name of newly created bdev. 3797 3798### Example 3799 3800Example request: 3801 3802~~~ 3803{ 3804 "params": { 3805 "name": "nvme0" 3806 "trtype" "pcie" 3807 "traddr": "0000:00:04.0" 3808 "punits": "0-3" 3809 "uuid": "4a7481ce-786f-41a0-9b86-8f7465c8f4d3" 3810 }, 3811 "jsonrpc": "2.0", 3812 "method": "bdev_ftl_create", 3813 "id": 1 3814} 3815~~~ 3816 3817Example response: 3818 3819~~~ 3820{ 3821 "jsonrpc": "2.0", 3822 "id": 1, 3823 "result": { 3824 "name" : "nvme0" 3825 "uuid" : "4a7481ce-786f-41a0-9b86-8f7465c8f4d3" 3826 } 3827} 3828~~~ 3829 3830## bdev_ftl_delete {#rpc_bdev_ftl_delete} 3831 3832Delete FTL bdev. 3833 3834This RPC is subject to change. 3835 3836### Parameters 3837 3838Name | Optional | Type | Description 3839----------------------- | -------- | ----------- | ----------- 3840name | Required | string | Bdev name 3841 3842### Example 3843 3844Example request: 3845 3846~~~ 3847{ 3848 "params": { 3849 "name": "nvme0" 3850 }, 3851 "jsonrpc": "2.0", 3852 "method": "bdev_ftl_delete", 3853 "id": 1 3854} 3855~~~ 3856 3857Example response: 3858 3859~~~ 3860{ 3861 "jsonrpc": "2.0", 3862 "id": 1, 3863 "result": true 3864} 3865~~~ 3866 3867## bdev_ocssd_create {#rpc_bdev_ocssd_create} 3868 3869Create Open Channel zoned bdev on specified Open Channel controller. 3870 3871### Parameters 3872 3873Name | Optional | Type | Description 3874----------------------- | -------- | ----------- | ----------- 3875ctrlr_name | Required | string | OC NVMe controller 3876name | Required | string | Bdev name to create 3877nsid | Optional | string | namespace ID 3878 3879### Example 3880 3881Example request: 3882 3883~~~ 3884{ 3885 "jsonrpc": "2.0", 3886 "method": "bdev_ocssd_create", 3887 "id": 1, 3888 "params": { 3889 "ctrlr_name": "nvme0", 3890 "bdev_name": "nvme0n1" 3891 } 3892} 3893~~~ 3894 3895Example response: 3896 3897~~~ 3898{ 3899 "jsonrpc": "2.0", 3900 "id": 1, 3901 "result": true 3902} 3903~~~ 3904 3905## bdev_ocssd_delete {#rpc_bdev_ocssd_delete} 3906 3907Delete Open Channel zoned bdev. 3908 3909### Parameters 3910 3911Name | Optional | Type | Description 3912----------------------- | -------- | ----------- | ----------- 3913name | Required | string | Bdev name to delete 3914 3915### Example 3916 3917Example request: 3918 3919~~~ 3920{ 3921 "jsonrpc": "2.0", 3922 "method": "bdev_ocssd_delete", 3923 "id": 1, 3924 "params": { 3925 "name": "nvme0n1" 3926 } 3927} 3928~~~ 3929 3930Example response: 3931 3932~~~ 3933{ 3934 "jsonrpc": "2.0", 3935 "id": 1, 3936 "result": true 3937} 3938~~~ 3939 3940## bdev_pmem_create_pool {#rpc_bdev_pmem_create_pool} 3941 3942Create a @ref bdev_config_pmem blk pool file. It is equivalent of following `pmempool create` command: 3943 3944~~~ 3945pmempool create -s $((num_blocks * block_size)) blk $block_size $pmem_file 3946~~~ 3947 3948This method is available only if SPDK was built with PMDK support. 3949 3950### Parameters 3951 3952Name | Optional | Type | Description 3953----------------------- | -------- | ----------- | ----------- 3954pmem_file | Required | string | Path to new pmem file 3955num_blocks | Required | number | Number of blocks 3956block_size | Required | number | Size of each block in bytes 3957 3958### Example 3959 3960Example request: 3961 3962~~~ 3963{ 3964 "params": { 3965 "block_size": 512, 3966 "num_blocks": 131072, 3967 "pmem_file": "/tmp/pmem_file" 3968 }, 3969 "jsonrpc": "2.0", 3970 "method": "bdev_pmem_create_pool", 3971 "id": 1 3972} 3973~~~ 3974 3975Example response: 3976 3977~~~ 3978{ 3979 "jsonrpc": "2.0", 3980 "id": 1, 3981 "result": true 3982} 3983~~~ 3984 3985## bdev_pmem_get_pool_info {#rpc_bdev_pmem_get_pool_info} 3986 3987Retrieve basic information about PMDK memory pool. 3988 3989This method is available only if SPDK was built with PMDK support. 3990 3991### Parameters 3992 3993Name | Optional | Type | Description 3994----------------------- | -------- | ----------- | ----------- 3995pmem_file | Required | string | Path to existing pmem file 3996 3997### Result 3998 3999Array of objects describing memory pool: 4000 4001Name | Type | Description 4002----------------------- | ----------- | ----------- 4003num_blocks | number | Number of blocks 4004block_size | number | Size of each block in bytes 4005 4006### Example 4007 4008Example request: 4009 4010~~~ 4011request: 4012{ 4013 "params": { 4014 "pmem_file": "/tmp/pmem_file" 4015 }, 4016 "jsonrpc": "2.0", 4017 "method": "bdev_pmem_get_pool_info", 4018 "id": 1 4019} 4020~~~ 4021 4022Example response: 4023 4024~~~ 4025{ 4026 "jsonrpc": "2.0", 4027 "id": 1, 4028 "result": [ 4029 { 4030 "block_size": 512, 4031 "num_blocks": 129728 4032 } 4033 ] 4034} 4035~~~ 4036 4037## bdev_pmem_delete_pool {#rpc_bdev_pmem_delete_pool} 4038 4039Delete pmem pool by removing file `pmem_file`. This method will fail if `pmem_file` is not a 4040valid pmem pool file. 4041 4042This method is available only if SPDK was built with PMDK support. 4043 4044### Parameters 4045 4046Name | Optional | Type | Description 4047----------------------- | -------- | ----------- | ----------- 4048pmem_file | Required | string | Path to new pmem file 4049 4050### Example 4051 4052Example request: 4053 4054~~~ 4055{ 4056 "params": { 4057 "pmem_file": "/tmp/pmem_file" 4058 }, 4059 "jsonrpc": "2.0", 4060 "method": "bdev_pmem_delete_pool", 4061 "id": 1 4062} 4063~~~ 4064 4065Example response: 4066 4067~~~ 4068{ 4069 "jsonrpc": "2.0", 4070 "id": 1, 4071 "result": true 4072} 4073~~~ 4074 4075## bdev_pmem_create {#rpc_bdev_pmem_create} 4076 4077Construct @ref bdev_config_pmem bdev. 4078 4079This method is available only if SPDK was built with PMDK support. 4080 4081### Parameters 4082 4083Name | Optional | Type | Description 4084----------------------- | -------- | ----------- | ----------- 4085name | Required | string | Bdev name 4086pmem_file | Required | string | Path to existing pmem blk pool file 4087 4088### Result 4089 4090Name of newly created bdev. 4091 4092### Example 4093 4094Example request: 4095 4096~~~ 4097{ 4098 "params": { 4099 "pmem_file": "/tmp/pmem_file", 4100 "name": "Pmem0" 4101 }, 4102 "jsonrpc": "2.0", 4103 "method": "bdev_pmem_create", 4104 "id": 1 4105} 4106~~~ 4107 4108Example response: 4109 4110~~~ 4111{ 4112 "jsonrpc": "2.0", 4113 "id": 1, 4114 "result": "Pmem0" 4115} 4116~~~ 4117 4118## bdev_pmem_delete {#rpc_bdev_pmem_delete} 4119 4120Delete @ref bdev_config_pmem bdev. This call will not remove backing pool files. 4121 4122This method is available only if SPDK was built with PMDK support. 4123 4124### Result 4125 4126`true` if bdev with provided name was deleted or `false` otherwise. 4127 4128### Parameters 4129 4130Name | Optional | Type | Description 4131----------------------- | -------- | ----------- | ----------- 4132name | Required | string | Bdev name 4133 4134### Example 4135 4136Example request: 4137 4138~~~ 4139{ 4140 "params": { 4141 "name": "Pmem0" 4142 }, 4143 "jsonrpc": "2.0", 4144 "method": "bdev_pmem_delete", 4145 "id": 1 4146} 4147~~~ 4148 4149Example response: 4150 4151~~~ 4152{ 4153 "jsonrpc": "2.0", 4154 "id": 1, 4155 "result": true 4156} 4157~~~ 4158 4159## bdev_passthru_create {#rpc_bdev_passthru_create} 4160 4161Create passthru bdev. This bdev type redirects all IO to it's base bdev. It has no other purpose than being an example 4162and a starting point in development of new bdev type. 4163 4164### Parameters 4165 4166Name | Optional | Type | Description 4167----------------------- | -------- | ----------- | ----------- 4168name | Required | string | Bdev name 4169base_bdev_name | Required | string | Base bdev name 4170 4171### Result 4172 4173Name of newly created bdev. 4174 4175### Example 4176 4177Example request: 4178 4179~~~ 4180{ 4181 "params": { 4182 "base_bdev_name": "Malloc0", 4183 "name": "Passsthru0" 4184 }, 4185 "jsonrpc": "2.0", 4186 "method": "bdev_passthru_create", 4187 "id": 1 4188} 4189~~~ 4190 4191Example response: 4192 4193~~~ 4194{ 4195 "jsonrpc": "2.0", 4196 "id": 1, 4197 "result": "Passsthru0" 4198} 4199~~~ 4200 4201## bdev_passthru_delete {#rpc_bdev_passthru_delete} 4202 4203Delete passthru bdev. 4204 4205### Parameters 4206 4207Name | Optional | Type | Description 4208----------------------- | -------- | ----------- | ----------- 4209name | Required | string | Bdev name 4210 4211### Example 4212 4213Example request: 4214 4215~~~ 4216{ 4217 "params": { 4218 "name": "Passsthru0" 4219 }, 4220 "jsonrpc": "2.0", 4221 "method": "bdev_passthru_delete", 4222 "id": 1 4223} 4224 4225~~~ 4226 4227Example response: 4228 4229~~~ 4230{ 4231 "jsonrpc": "2.0", 4232 "id": 1, 4233 "result": true 4234} 4235~~~ 4236 4237## bdev_virtio_attach_controller {#rpc_bdev_virtio_attach_controller} 4238 4239Create new initiator @ref bdev_config_virtio_scsi or @ref bdev_config_virtio_blk and expose all found bdevs. 4240 4241### Parameters 4242 4243Name | Optional | Type | Description 4244----------------------- | -------- | ----------- | ----------- 4245name | Required | string | Virtio SCSI base bdev name or Virtio Blk bdev name 4246trtype | Required | string | Virtio target trtype: pci or user 4247traddr | Required | string | target address: BDF or UNIX socket file path 4248dev_type | Required | string | Virtio device type: blk or scsi 4249vq_count | Optional | number | Number of queues this controller will utilize (default: 1) 4250vq_size | Optional | number | Size of each queue. Must be power of 2. (default: 512) 4251 4252In case of Virtio SCSI the `name` parameter will be base name for new created bdevs. For Virtio Blk `name` will be the 4253name of created bdev. 4254 4255`vq_count` and `vq_size` parameters are valid only if `trtype` is `user`. 4256 4257### Result 4258 4259Array of names of newly created bdevs. 4260 4261### Example 4262 4263Example request: 4264 4265~~~ 4266{ 4267 "params": { 4268 "name": "VirtioScsi0", 4269 "trtype": "user", 4270 "vq_size": 128, 4271 "dev_type": "scsi", 4272 "traddr": "/tmp/VhostScsi0", 4273 "vq_count": 4 4274 }, 4275 "jsonrpc": "2.0", 4276 "method": "bdev_virtio_attach_controller", 4277 "id": 1 4278} 4279~~~ 4280 4281Example response: 4282 4283~~~ 4284{ 4285 "jsonrpc": "2.0", 4286 "id": 1, 4287 "result": ["VirtioScsi0t2", "VirtioScsi0t4"] 4288} 4289~~~ 4290 4291## bdev_virtio_scsi_get_devices {#rpc_bdev_virtio_scsi_get_devices} 4292 4293Show information about all available Virtio SCSI devices. 4294 4295### Parameters 4296 4297This method has no parameters. 4298 4299### Result 4300 4301Array of Virtio SCSI information objects. 4302 4303### Example 4304 4305Example request: 4306 4307~~~ 4308{ 4309 "jsonrpc": "2.0", 4310 "method": "bdev_virtio_scsi_get_devices", 4311 "id": 1 4312} 4313~~~ 4314 4315Example response: 4316 4317~~~ 4318{ 4319 "jsonrpc": "2.0", 4320 "id": 1, 4321 "result": [ 4322 { 4323 "name": "VirtioScsi0", 4324 "virtio": { 4325 "vq_size": 128, 4326 "vq_count": 4, 4327 "type": "user", 4328 "socket": "/tmp/VhostScsi0" 4329 } 4330 } 4331 ] 4332} 4333~~~ 4334 4335## bdev_virtio_detach_controller {#rpc_bdev_virtio_detach_controller} 4336 4337Remove a Virtio device. This command can be used to remove any type of virtio device. 4338 4339### Parameters 4340 4341Name | Optional | Type | Description 4342----------------------- | -------- | ----------- | ----------- 4343name | Required | string | Virtio name 4344 4345### Example 4346 4347Example request: 4348 4349~~~ 4350{ 4351 "params": { 4352 "name": "VirtioUser0" 4353 }, 4354 "jsonrpc": "2.0", 4355 "method": "bdev_virtio_detach_controller", 4356 "id": 1 4357} 4358 4359~~~ 4360 4361Example response: 4362 4363~~~ 4364{ 4365 "jsonrpc": "2.0", 4366 "id": 1, 4367 "result": true 4368} 4369~~~ 4370 4371## bdev_virtio_blk_set_hotplug {#rpc_bdev_virtio_blk_set_hotplug} 4372 4373Enable/Disable the virtio blk hotplug monitor or change the monitor period time 4374 4375### Parameters 4376 4377Name | Optional | Type | Description 4378----------------------- | -------- | ----------- | ----------- 4379enable | Required | bool | Enable or disable the virtio blk hotplug monitor 4380period-us | Optional | number | The period time of the monitor 4381 4382When the enable is true then the period-us is optional. If user don't set the period time then use the default 4383value. When the enable is false then the period-us is not required. 4384 4385### Result 4386 4387True the rpc is successful otherwise false 4388 4389### Example 4390 4391Example request: 4392 4393~~~ 4394{ 4395 "params": { 4396 "enable": "true", 4397 "period-us": "1000000" 4398 }, 4399 "jsonrpc": "2.0", 4400 "method": "bdev_virtio_blk_set_hotplug", 4401 "id": 1 4402} 4403~~~ 4404 4405Example response: 4406 4407~~~ 4408{ 4409 "jsonrpc": "2.0", 4410 "id": 1, 4411 "result": true 4412} 4413~~~ 4414 4415# iSCSI Target {#jsonrpc_components_iscsi_tgt} 4416 4417## iscsi_set_options method {#rpc_iscsi_set_options} 4418 4419Set global parameters for iSCSI targets. 4420 4421This RPC may only be called before SPDK subsystems have been initialized. This RPC can be called only once. 4422 4423### Parameters 4424 4425Name | Optional | Type | Description 4426------------------------------- | -------- | ------- | ----------- 4427auth_file | Optional | string | Path to CHAP shared secret file (default: "") 4428node_base | Optional | string | Prefix of the name of iSCSI target node (default: "iqn.2016-06.io.spdk") 4429nop_timeout | Optional | number | Timeout in seconds to nop-in request to the initiator (default: 60) 4430nop_in_interval | Optional | number | Time interval in secs between nop-in requests by the target (default: 30) 4431disable_chap | Optional | boolean | CHAP for discovery session should be disabled (default: `false`) 4432require_chap | Optional | boolean | CHAP for discovery session should be required (default: `false`) 4433mutual_chap | Optional | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`) 4434chap_group | Optional | number | CHAP group ID for discovery session (default: 0) 4435max_sessions | Optional | number | Maximum number of sessions in the host (default: 128) 4436max_queue_depth | Optional | number | Maximum number of outstanding I/Os per queue (default: 64) 4437max_connections_per_session | Optional | number | Session specific parameter, MaxConnections (default: 2) 4438default_time2wait | Optional | number | Session specific parameter, DefaultTime2Wait (default: 2) 4439default_time2retain | Optional | number | Session specific parameter, DefaultTime2Retain (default: 20) 4440first_burst_length | Optional | number | Session specific parameter, FirstBurstLength (default: 8192) 4441immediate_data | Optional | boolean | Session specific parameter, ImmediateData (default: `true`) 4442error_recovery_level | Optional | number | Session specific parameter, ErrorRecoveryLevel (default: 0) 4443allow_duplicated_isid | Optional | boolean | Allow duplicated initiator session ID (default: `false`) 4444max_large_datain_per_connection | Optional | number | Max number of outstanding split read I/Os per connection (default: 64) 4445max_r2t_per_connection | Optional | number | Max number of outstanding R2Ts per connection (default: 4) 4446 4447To load CHAP shared secret file, its path is required to specify explicitly in the parameter `auth_file`. 4448 4449Parameters `disable_chap` and `require_chap` are mutually exclusive. Parameters `no_discovery_auth`, `req_discovery_auth`, `req_discovery_auth_mutual`, and `discovery_auth_group` are still available instead of `disable_chap`, `require_chap`, `mutual_chap`, and `chap_group`, respectivey but will be removed in future releases. 4450 4451### Example 4452 4453Example request: 4454 4455~~~ 4456{ 4457 "params": { 4458 "allow_duplicated_isid": true, 4459 "default_time2retain": 60, 4460 "first_burst_length": 8192, 4461 "immediate_data": true, 4462 "node_base": "iqn.2016-06.io.spdk", 4463 "max_sessions": 128, 4464 "nop_timeout": 30, 4465 "nop_in_interval": 30, 4466 "auth_file": "/usr/local/etc/spdk/auth.conf", 4467 "disable_chap": true, 4468 "default_time2wait": 2 4469 }, 4470 "jsonrpc": "2.0", 4471 "method": "iscsi_set_options", 4472 "id": 1 4473} 4474~~~ 4475 4476Example response: 4477 4478~~~ 4479{ 4480 "jsonrpc": "2.0", 4481 "id": 1, 4482 "result": true 4483} 4484~~~ 4485 4486## iscsi_get_options method {#rpc_iscsi_get_options} 4487 4488Show global parameters of iSCSI targets. 4489 4490### Parameters 4491 4492This method has no parameters. 4493 4494### Example 4495 4496Example request: 4497 4498~~~ 4499request: 4500{ 4501 "jsonrpc": "2.0", 4502 "method": "iscsi_get_options", 4503 "id": 1 4504} 4505~~~ 4506 4507Example response: 4508 4509~~~ 4510{ 4511 "jsonrpc": "2.0", 4512 "id": 1, 4513 "result": { 4514 "allow_duplicated_isid": true, 4515 "default_time2retain": 60, 4516 "first_burst_length": 8192, 4517 "immediate_data": true, 4518 "node_base": "iqn.2016-06.io.spdk", 4519 "mutual_chap": false, 4520 "nop_in_interval": 30, 4521 "chap_group": 0, 4522 "max_connections_per_session": 2, 4523 "max_queue_depth": 64, 4524 "nop_timeout": 30, 4525 "max_sessions": 128, 4526 "error_recovery_level": 0, 4527 "auth_file": "/usr/local/etc/spdk/auth.conf", 4528 "disable_chap": true, 4529 "default_time2wait": 2, 4530 "require_chap": false, 4531 "max_large_datain_per_connection": 64, 4532 "max_r2t_per_connection": 4 4533 } 4534} 4535~~~ 4536 4537## scsi_get_devices {#rpc_scsi_get_devices} 4538 4539Display SCSI devices 4540 4541### Parameters 4542 4543This method has no parameters. 4544 4545### Example 4546 4547Example request: 4548 4549~~~ 4550{ 4551 "jsonrpc": "2.0", 4552 "method": "scsi_get_devices", 4553 "id": 1 4554} 4555~~~ 4556 4557Example response: 4558 4559~~~ 4560{ 4561 "jsonrpc": "2.0", 4562 "id": 1, 4563 "result": [ 4564 { 4565 "id": 0, 4566 "device_name": "iqn.2016-06.io.spdk:Target3" 4567 } 4568 ] 4569} 4570~~~ 4571 4572## iscsi_set_discovery_auth method {#rpc_iscsi_set_discovery_auth} 4573 4574Set CHAP authentication for sessions dynamically. 4575 4576### Parameters 4577 4578Name | Optional | Type | Description 4579--------------------------- | -------- | --------| ----------- 4580disable_chap | Optional | boolean | CHAP for discovery session should be disabled (default: `false`) 4581require_chap | Optional | boolean | CHAP for discovery session should be required (default: `false`) 4582mutual_chap | Optional | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`) 4583chap_group | Optional | number | CHAP group ID for discovery session (default: 0) 4584 4585Parameters `disable_chap` and `require_chap` are mutually exclusive. 4586 4587### Example 4588 4589Example request: 4590 4591~~~ 4592request: 4593{ 4594 "params": { 4595 "chap_group": 1, 4596 "require_chap": true, 4597 "mutual_chap": true 4598 }, 4599 "jsonrpc": "2.0", 4600 "method": "iscsi_set_discovery_auth", 4601 "id": 1 4602} 4603~~~ 4604 4605Example response: 4606 4607~~~ 4608{ 4609 "jsonrpc": "2.0", 4610 "id": 1, 4611 "result": true 4612} 4613~~~ 4614 4615## iscsi_create_auth_group method {#rpc_iscsi_create_auth_group} 4616 4617Create an authentication group for CHAP authentication. 4618 4619### Parameters 4620 4621Name | Optional | Type | Description 4622--------------------------- | -------- | --------| ----------- 4623tag | Required | number | Authentication group tag (unique, integer > 0) 4624secrets | Optional | array | Array of @ref rpc_iscsi_create_auth_group_secret objects 4625 4626### secret {#rpc_iscsi_create_auth_group_secret} 4627 4628Name | Optional | Type | Description 4629--------------------------- | ---------| --------| ----------- 4630user | Required | string | Unidirectional CHAP name 4631secret | Required | string | Unidirectional CHAP secret 4632muser | Optional | string | Bidirectional CHAP name 4633msecret | Optional | string | Bidirectional CHAP secret 4634 4635### Example 4636 4637Example request: 4638 4639~~~ 4640{ 4641 "params": { 4642 "secrets": [ 4643 { 4644 "muser": "mu1", 4645 "secret": "s1", 4646 "user": "u1", 4647 "msecret": "ms1" 4648 } 4649 ], 4650 "tag": 2 4651 }, 4652 "jsonrpc": "2.0", 4653 "method": "iscsi_create_auth_group", 4654 "id": 1 4655} 4656~~~ 4657 4658Example response: 4659 4660~~~ 4661{ 4662 "jsonrpc": "2.0", 4663 "id": 1, 4664 "result": true 4665} 4666~~~ 4667 4668## iscsi_delete_auth_group method {#rpc_iscsi_delete_auth_group} 4669 4670Delete an existing authentication group for CHAP authentication. 4671 4672### Parameters 4673 4674Name | Optional | Type | Description 4675--------------------------- | -------- | --------| ----------- 4676tag | Required | number | Authentication group tag (unique, integer > 0) 4677 4678### Example 4679 4680Example request: 4681 4682~~~ 4683{ 4684 "params": { 4685 "tag": 2 4686 }, 4687 "jsonrpc": "2.0", 4688 "method": "iscsi_delete_auth_group", 4689 "id": 1 4690} 4691~~~ 4692 4693Example response: 4694 4695~~~ 4696{ 4697 "jsonrpc": "2.0", 4698 "id": 1, 4699 "result": true 4700} 4701~~~ 4702 4703## iscsi_get_auth_groups {#rpc_iscsi_get_auth_groups} 4704 4705Show information about all existing authentication group for CHAP authentication. 4706 4707### Parameters 4708 4709This method has no parameters. 4710 4711### Result 4712 4713Array of objects describing authentication group. 4714 4715Name | Type | Description 4716--------------------------- | --------| ----------- 4717tag | number | Authentication group tag 4718secrets | array | Array of @ref rpc_iscsi_create_auth_group_secret objects 4719 4720### Example 4721 4722Example request: 4723 4724~~~ 4725{ 4726 "jsonrpc": "2.0", 4727 "method": "iscsi_get_auth_groups", 4728 "id": 1 4729} 4730~~~ 4731Example response: 4732 4733~~~ 4734{ 4735 "jsonrpc": "2.0", 4736 "id": 1, 4737 "result": [ 4738 { 4739 "secrets": [ 4740 { 4741 "muser": "mu1", 4742 "secret": "s1", 4743 "user": "u1", 4744 "msecret": "ms1" 4745 } 4746 ], 4747 "tag": 1 4748 }, 4749 { 4750 "secrets": [ 4751 { 4752 "secret": "s2", 4753 "user": "u2" 4754 } 4755 ], 4756 "tag": 2 4757 } 4758 ] 4759} 4760~~~ 4761 4762## iscsi_auth_group_add_secret {#rpc_iscsi_auth_group_add_secret} 4763 4764Add a secret to an existing authentication group for CHAP authentication. 4765 4766### Parameters 4767 4768Name | Optional | Type | Description 4769--------------------------- | -------- | --------| ----------- 4770tag | Required | number | Authentication group tag (unique, integer > 0) 4771user | Required | string | Unidirectional CHAP name 4772secret | Required | string | Unidirectional CHAP secret 4773muser | Optional | string | Bidirectional CHAP name 4774msecret | Optional | string | Bidirectional CHAP secret 4775 4776### Example 4777 4778Example request: 4779 4780~~~ 4781{ 4782 "params": { 4783 "muser": "mu3", 4784 "secret": "s3", 4785 "tag": 2, 4786 "user": "u3", 4787 "msecret": "ms3" 4788 }, 4789 "jsonrpc": "2.0", 4790 "method": "iscsi_auth_group_add_secret", 4791 "id": 1 4792} 4793~~~ 4794 4795Example response: 4796 4797~~~ 4798{ 4799 "jsonrpc": "2.0", 4800 "id": 1, 4801 "result": true 4802} 4803~~~ 4804 4805## iscsi_auth_group_remove_secret {#rpc_iscsi_auth_group_remove_secret} 4806 4807Remove a secret from an existing authentication group for CHAP authentication. 4808 4809### Parameters 4810 4811Name | Optional | Type | Description 4812--------------------------- | -------- | --------| ----------- 4813tag | Required | number | Authentication group tag (unique, integer > 0) 4814user | Required | string | Unidirectional CHAP name 4815 4816### Example 4817 4818Example request: 4819 4820~~~ 4821{ 4822 "params": { 4823 "tag": 2, 4824 "user": "u3" 4825 }, 4826 "jsonrpc": "2.0", 4827 "method": "iscsi_auth_group_remove_secret", 4828 "id": 1 4829} 4830~~~ 4831 4832Example response: 4833 4834~~~ 4835{ 4836 "jsonrpc": "2.0", 4837 "id": 1, 4838 "result": true 4839} 4840~~~ 4841 4842## iscsi_get_initiator_groups method {#rpc_iscsi_get_initiator_groups} 4843 4844Show information about all available initiator groups. 4845 4846### Parameters 4847 4848This method has no parameters. 4849 4850### Result 4851 4852Array of objects describing initiator groups. 4853 4854Name | Type | Description 4855--------------------------- | --------| ----------- 4856tag | number | Initiator group tag 4857initiators | array | Array of initiator hostnames or IP addresses 4858netmasks | array | Array of initiator netmasks 4859 4860### Example 4861 4862Example request: 4863 4864~~~ 4865{ 4866 "jsonrpc": "2.0", 4867 "method": "iscsi_get_initiator_groups", 4868 "id": 1 4869} 4870~~~ 4871 4872Example response: 4873 4874~~~ 4875{ 4876 "jsonrpc": "2.0", 4877 "id": 1, 4878 "result": [ 4879 { 4880 "initiators": [ 4881 "iqn.2016-06.io.spdk:host1", 4882 "iqn.2016-06.io.spdk:host2" 4883 ], 4884 "tag": 1, 4885 "netmasks": [ 4886 "192.168.1.0/24" 4887 ] 4888 } 4889 ] 4890} 4891~~~ 4892 4893## iscsi_create_initiator_group method {#rpc_iscsi_create_initiator_group} 4894 4895Add an initiator group. 4896 4897### Parameters 4898 4899Name | Optional | Type | Description 4900--------------------------- | -------- | --------| ----------- 4901tag | Required | number | Initiator group tag (unique, integer > 0) 4902initiators | Required | array | Not empty array of initiator hostnames or IP addresses 4903netmasks | Required | array | Not empty array of initiator netmasks 4904 4905### Example 4906 4907Example request: 4908 4909~~~ 4910{ 4911 "params": { 4912 "initiators": [ 4913 "iqn.2016-06.io.spdk:host1", 4914 "iqn.2016-06.io.spdk:host2" 4915 ], 4916 "tag": 1, 4917 "netmasks": [ 4918 "192.168.1.0/24" 4919 ] 4920 }, 4921 "jsonrpc": "2.0", 4922 "method": "iscsi_create_initiator_group", 4923 "id": 1 4924} 4925~~~ 4926 4927Example response: 4928 4929~~~ 4930response: 4931{ 4932 "jsonrpc": "2.0", 4933 "id": 1, 4934 "result": true 4935} 4936~~~ 4937 4938## iscsi_delete_initiator_group method {#rpc_iscsi_delete_initiator_group} 4939 4940Delete an existing initiator group. 4941 4942### Parameters 4943 4944Name | Optional | Type | Description 4945--------------------------- | -------- | --------| ----------- 4946tag | Required | number | Initiator group tag (unique, integer > 0) 4947 4948### Example 4949 4950Example request: 4951 4952~~~ 4953{ 4954 "params": { 4955 "tag": 1 4956 }, 4957 "jsonrpc": "2.0", 4958 "method": "iscsi_delete_initiator_group", 4959 "id": 1 4960} 4961~~~ 4962 4963Example response: 4964 4965~~~ 4966{ 4967 "jsonrpc": "2.0", 4968 "id": 1, 4969 "result": true 4970} 4971~~~ 4972 4973## iscsi_initiator_group_add_initiators method {#rpc_iscsi_initiator_group_add_initiators} 4974 4975Add initiators to an existing initiator group. 4976 4977### Parameters 4978 4979Name | Optional | Type | Description 4980--------------------------- | -------- | --------| ----------- 4981tag | Required | number | Existing initiator group tag. 4982initiators | Optional | array | Array of initiator hostnames or IP addresses 4983netmasks | Optional | array | Array of initiator netmasks 4984 4985### Example 4986 4987Example request: 4988 4989~~~ 4990request: 4991{ 4992 "params": { 4993 "initiators": [ 4994 "iqn.2016-06.io.spdk:host3" 4995 ], 4996 "tag": 1, 4997 "netmasks": [ 4998 "255.255.255.1" 4999 ] 5000 }, 5001 "jsonrpc": "2.0", 5002 "method": "iscsi_initiator_group_add_initiators", 5003 "id": 1 5004} 5005~~~ 5006 5007Example response: 5008 5009~~~ 5010response: 5011{ 5012 "jsonrpc": "2.0", 5013 "id": 1, 5014 "result": true 5015} 5016~~~ 5017 5018## iscsi_initiator_group_remove_initiators method {#rpc_iscsi_initiator_group_remove_initiators} 5019 5020Remove initiators from an initiator group. 5021 5022### Parameters 5023 5024Name | Optional | Type | Description 5025--------------------------- | -------- | --------| ----------- 5026tag | Required | number | Existing initiator group tag. 5027initiators | Optional | array | Array of initiator hostnames or IP addresses 5028netmasks | Optional | array | Array of initiator netmasks 5029 5030### Example 5031 5032Example request: 5033 5034~~~ 5035request: 5036{ 5037 "params": { 5038 "initiators": [ 5039 "iqn.2016-06.io.spdk:host3" 5040 ], 5041 "tag": 1, 5042 "netmasks": [ 5043 "255.255.255.1" 5044 ] 5045 }, 5046 "jsonrpc": "2.0", 5047 "method": "iscsi_initiator_group_remove_initiators", 5048 "id": 1 5049} 5050~~~ 5051 5052Example response: 5053 5054~~~ 5055response: 5056{ 5057 "jsonrpc": "2.0", 5058 "id": 1, 5059 "result": true 5060} 5061~~~ 5062 5063## iscsi_get_target_nodes method {#rpc_iscsi_get_target_nodes} 5064 5065Show information about all available iSCSI target nodes. 5066 5067### Parameters 5068 5069This method has no parameters. 5070 5071### Result 5072 5073Array of objects describing target node. 5074 5075Name | Type | Description 5076--------------------------- | --------| ----------- 5077name | string | Target node name (ASCII) 5078alias_name | string | Target node alias name (ASCII) 5079pg_ig_maps | array | Array of Portal_Group_Tag:Initiator_Group_Tag mappings 5080luns | array | Array of Bdev names to LUN ID mappings 5081queue_depth | number | Target queue depth 5082disable_chap | boolean | CHAP authentication should be disabled for this target 5083require_chap | boolean | CHAP authentication should be required for this target 5084mutual_chap | boolean | CHAP authentication should be bidirectional (`true`) or unidirectional (`false`) 5085chap_group | number | Authentication group ID for this target node 5086header_digest | boolean | Header Digest should be required for this target node 5087data_digest | boolean | Data Digest should be required for this target node 5088 5089### Example 5090 5091Example request: 5092 5093~~~ 5094{ 5095 "jsonrpc": "2.0", 5096 "method": "iscsi_get_target_nodes", 5097 "id": 1 5098} 5099~~~ 5100 5101Example response: 5102 5103~~~ 5104{ 5105 "jsonrpc": "2.0", 5106 "id": 1, 5107 "result": [ 5108 { 5109 "luns": [ 5110 { 5111 "lun_id": 0, 5112 "bdev_name": "Nvme0n1" 5113 } 5114 ], 5115 "mutual_chap": false, 5116 "name": "iqn.2016-06.io.spdk:target1", 5117 "alias_name": "iscsi-target1-alias", 5118 "require_chap": false, 5119 "chap_group": 0, 5120 "pg_ig_maps": [ 5121 { 5122 "ig_tag": 1, 5123 "pg_tag": 1 5124 } 5125 ], 5126 "data_digest": false, 5127 "disable_chap": false, 5128 "header_digest": false, 5129 "queue_depth": 64 5130 } 5131 ] 5132} 5133~~~ 5134 5135## iscsi_create_target_node method {#rpc_iscsi_create_target_node} 5136 5137Add an iSCSI target node. 5138 5139### Parameters 5140 5141Name | Optional | Type | Description 5142--------------------------- | -------- | --------| ----------- 5143name | Required | string | Target node name (ASCII) 5144alias_name | Required | string | Target node alias name (ASCII) 5145pg_ig_maps | Required | array | Array of (Portal_Group_Tag:Initiator_Group_Tag) mappings 5146luns | Required | array | Array of Bdev names to LUN ID mappings 5147queue_depth | Required | number | Target queue depth 5148disable_chap | Optional | boolean | CHAP authentication should be disabled for this target 5149require_chap | Optional | boolean | CHAP authentication should be required for this target 5150mutual_chap | Optional | boolean | CHAP authentication should be bidirectional (`true`) or unidirectional (`false`) 5151chap_group | Optional | number | Authentication group ID for this target node 5152header_digest | Optional | boolean | Header Digest should be required for this target node 5153data_digest | Optional | boolean | Data Digest should be required for this target node 5154 5155Parameters `disable_chap` and `require_chap` are mutually exclusive. 5156 5157### Example 5158 5159Example request: 5160 5161~~~ 5162{ 5163 "params": { 5164 "luns": [ 5165 { 5166 "lun_id": 0, 5167 "bdev_name": "Nvme0n1" 5168 } 5169 ], 5170 "mutual_chap": true, 5171 "name": "target2", 5172 "alias_name": "iscsi-target2-alias", 5173 "pg_ig_maps": [ 5174 { 5175 "ig_tag": 1, 5176 "pg_tag": 1 5177 }, 5178 { 5179 "ig_tag": 2, 5180 "pg_tag": 2 5181 } 5182 ], 5183 "data_digest": true, 5184 "disable_chap": true, 5185 "header_digest": true, 5186 "queue_depth": 24 5187 }, 5188 "jsonrpc": "2.0", 5189 "method": "iscsi_create_target_node", 5190 "id": 1 5191} 5192~~~ 5193 5194Example response: 5195 5196~~~ 5197{ 5198 "jsonrpc": "2.0", 5199 "id": 1, 5200 "result": true 5201} 5202~~~ 5203 5204## iscsi_target_node_set_auth method {#rpc_iscsi_target_node_set_auth} 5205 5206Set CHAP authentication to an existing iSCSI target node. 5207 5208### Parameters 5209 5210Name | Optional | Type | Description 5211--------------------------- | -------- | --------| ----------- 5212name | Required | string | Target node name (ASCII) 5213disable_chap | Optional | boolean | CHAP authentication should be disabled for this target 5214require_chap | Optional | boolean | CHAP authentication should be required for this target 5215mutual_chap | Optional | boolean | CHAP authentication should be bidirectional (`true`) or unidirectional (`false`) 5216chap_group | Optional | number | Authentication group ID for this target node 5217 5218Parameters `disable_chap` and `require_chap` are mutually exclusive. 5219 5220### Example 5221 5222Example request: 5223 5224~~~ 5225{ 5226 "params": { 5227 "chap_group": 1, 5228 "require_chap": true, 5229 "name": "iqn.2016-06.io.spdk:target1", 5230 "mutual_chap": true 5231 }, 5232 "jsonrpc": "2.0", 5233 "method": "iscsi_target_node_set_auth", 5234 "id": 1 5235} 5236~~~ 5237 5238Example response: 5239 5240~~~ 5241{ 5242 "jsonrpc": "2.0", 5243 "id": 1, 5244 "result": true 5245} 5246~~~ 5247 5248## iscsi_target_node_add_pg_ig_maps method {#rpc_iscsi_target_node_add_pg_ig_maps} 5249 5250Add initiator group to portal group mappings to an existing iSCSI target node. 5251 5252### Parameters 5253 5254Name | Optional | Type | Description 5255--------------------------- | -------- | --------| ----------- 5256name | Required | string | Target node name (ASCII) 5257pg_ig_maps | Required | array | Not empty array of initiator to portal group mappings objects 5258 5259Portal to Initiator group mappings object: 5260 5261Name | Optional | Type | Description 5262--------------------------- | -------- | --------| ----------- 5263ig_tag | Required | number | Existing initiator group tag 5264pg_tag | Required | number | Existing portal group tag 5265 5266### Example 5267 5268Example request: 5269 5270~~~ 5271{ 5272 "params": { 5273 "pg_ig_maps": [ 5274 { 5275 "ig_tag": 1, 5276 "pg_tag": 1 5277 }, 5278 { 5279 "ig_tag": 2, 5280 "pg_tag": 2 5281 }, 5282 { 5283 "ig_tag": 3, 5284 "pg_tag": 3 5285 } 5286 ], 5287 "name": "iqn.2016-06.io.spdk:target3" 5288 }, 5289 "jsonrpc": "2.0", 5290 "method": "iscsi_target_node_add_pg_ig_maps", 5291 "id": 1 5292} 5293~~~ 5294 5295Example response: 5296 5297~~~ 5298{ 5299 "jsonrpc": "2.0", 5300 "id": 1, 5301 "result": true 5302} 5303~~~ 5304 5305## iscsi_target_node_remove_pg_ig_maps method {#rpc_iscsi_target_node_remove_pg_ig_maps} 5306 5307Delete initiator group to portal group mappings from an existing iSCSI target node. 5308 5309### Parameters 5310 5311Name | Optional | Type | Description 5312--------------------------- | -------- | --------| ----------- 5313name | Required | string | Target node name (ASCII) 5314pg_ig_maps | Required | array | Not empty array of Portal to Initiator group mappings objects 5315 5316Portal to Initiator group mappings object: 5317 5318Name | Optional | Type | Description 5319--------------------------- | -------- | --------| ----------- 5320ig_tag | Required | number | Existing initiator group tag 5321pg_tag | Required | number | Existing portal group tag 5322 5323### Example 5324 5325Example request: 5326 5327~~~ 5328{ 5329 "params": { 5330 "pg_ig_maps": [ 5331 { 5332 "ig_tag": 1, 5333 "pg_tag": 1 5334 }, 5335 { 5336 "ig_tag": 2, 5337 "pg_tag": 2 5338 }, 5339 { 5340 "ig_tag": 3, 5341 "pg_tag": 3 5342 } 5343 ], 5344 "name": "iqn.2016-06.io.spdk:target3" 5345 }, 5346 "jsonrpc": "2.0", 5347 "method": "iscsi_target_node_remove_pg_ig_maps", 5348 "id": 1 5349} 5350~~~ 5351 5352Example response: 5353 5354~~~ 5355{ 5356 "jsonrpc": "2.0", 5357 "id": 1, 5358 "result": true 5359} 5360~~~ 5361 5362## iscsi_delete_target_node method {#rpc_iscsi_delete_target_node} 5363 5364Delete an iSCSI target node. 5365 5366### Parameters 5367 5368Name | Optional | Type | Description 5369--------------------------- | -------- | --------| ----------- 5370name | Required | string | Target node name (ASCII) 5371 5372### Example 5373 5374Example request: 5375 5376~~~ 5377{ 5378 "params": { 5379 "name": "iqn.2016-06.io.spdk:target1" 5380 }, 5381 "jsonrpc": "2.0", 5382 "method": "iscsi_delete_target_node", 5383 "id": 1 5384} 5385~~~ 5386 5387Example response: 5388 5389~~~ 5390{ 5391 "jsonrpc": "2.0", 5392 "id": 1, 5393 "result": true 5394} 5395~~~ 5396 5397## iscsi_get_portal_groups method {#rpc_iscsi_get_portal_groups} 5398 5399Show information about all available portal groups. 5400 5401### Parameters 5402 5403This method has no parameters. 5404 5405### Example 5406 5407Example request: 5408 5409~~~ 5410request: 5411{ 5412 "jsonrpc": "2.0", 5413 "method": "iscsi_get_portal_groups", 5414 "id": 1 5415} 5416~~~ 5417 5418Example response: 5419 5420~~~ 5421{ 5422 "jsonrpc": "2.0", 5423 "id": 1, 5424 "result": [ 5425 { 5426 "portals": [ 5427 { 5428 "host": "127.0.0.1", 5429 "port": "3260" 5430 } 5431 ], 5432 "tag": 1, 5433 "private": false 5434 } 5435 ] 5436} 5437~~~ 5438 5439## iscsi_create_portal_group method {#rpc_iscsi_create_portal_group} 5440 5441Add a portal group. 5442 5443### Parameters 5444 5445Name | Optional | Type | Description 5446--------------------------- | -------- | --------| ----------- 5447tag | Required | number | Portal group tag 5448portals | Required | array | Not empty array of portals 5449private | Optional | boolean | When true, portals in this group are not returned by a discovery session. Used for login redirection. (default: `false`) 5450wait | Optional | boolean | When true, do not listen on portals until it is started explicitly. (default: `false`) 5451 5452Portal object 5453 5454Name | Optional | Type | Description 5455--------------------------- | -------- | --------| ----------- 5456host | Required | string | Hostname or IP address 5457port | Required | string | Port number 5458 5459### Example 5460 5461Example request: 5462 5463~~~ 5464{ 5465 "params": { 5466 "portals": [ 5467 { 5468 "host": "127.0.0.1", 5469 "port": "3260" 5470 } 5471 ], 5472 "tag": 1 5473 }, 5474 "jsonrpc": "2.0", 5475 "method": "iscsi_create_portal_group", 5476 "id": 1 5477} 5478~~~ 5479 5480Example response: 5481 5482~~~ 5483{ 5484 "jsonrpc": "2.0", 5485 "id": 1, 5486 "result": true 5487} 5488~~~ 5489 5490## iscsi_start_portal_group method {#rpc_iscsi_start_portal_group} 5491 5492Start listening on portals if the portal group is not started yet, or do nothing 5493if the portal group already started. Return a success response for both cases. 5494 5495### Parameters 5496 5497Name | Optional | Type | Description 5498--------------------------- | -------- | --------| ----------- 5499tag | Required | number | Existing portal group tag 5500 5501### Example 5502 5503Example request: 5504 5505~~~ 5506{ 5507 "params": { 5508 "tag": 1 5509 }, 5510 "jsonrpc": "2.0", 5511 "method": "iscsi_start_portal_group", 5512 "id": 1 5513} 5514~~~ 5515 5516Example response: 5517 5518~~~ 5519{ 5520 "jsonrpc": "2.0", 5521 "id": 1, 5522 "result": true 5523} 5524~~~ 5525 5526## iscsi_delete_portal_group method {#rpc_iscsi_delete_portal_group} 5527 5528Delete an existing portal group. 5529 5530### Parameters 5531 5532Name | Optional | Type | Description 5533--------------------------- | -------- | --------| ----------- 5534tag | Required | number | Existing portal group tag 5535 5536### Example 5537 5538Example request: 5539 5540~~~ 5541{ 5542 "params": { 5543 "tag": 1 5544 }, 5545 "jsonrpc": "2.0", 5546 "method": "iscsi_delete_portal_group", 5547 "id": 1 5548} 5549~~~ 5550 5551Example response: 5552 5553~~~ 5554{ 5555 "jsonrpc": "2.0", 5556 "id": 1, 5557 "result": true 5558} 5559~~~ 5560 5561## iscsi_portal_group_set_auth method {#rpc_iscsi_portal_group_set_auth} 5562 5563Set CHAP authentication for discovery sessions specific for the existing iSCSI portal group. 5564This RPC overwrites the setting by the global parameters for the iSCSI portal group. 5565 5566### Parameters 5567 5568Name | Optional | Type | Description 5569--------------------------- | -------- | --------| ----------- 5570disable_chap | Optional | boolean | CHAP for discovery session should be disabled (default: `false`) 5571require_chap | Optional | boolean | CHAP for discovery session should be required (default: `false`) 5572mutual_chap | Optional | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`) 5573chap_group | Optional | number | CHAP group ID for discovery session (default: 0) 5574 5575Parameters `disable_chap` and `require_chap` are mutually exclusive. 5576 5577### Example 5578 5579Example request: 5580 5581~~~ 5582request: 5583{ 5584 "params": { 5585 "tag": 1, 5586 "chap_group": 1, 5587 "require_chap": true, 5588 "mutual_chap": true 5589 }, 5590 "jsonrpc": "2.0", 5591 "method": "iscsi_portal_group_set_auth", 5592 "id": 1 5593} 5594~~~ 5595 5596Example response: 5597 5598~~~ 5599{ 5600 "jsonrpc": "2.0", 5601 "id": 1, 5602 "result": true 5603} 5604~~~ 5605 5606## iscsi_get_connections method {#rpc_iscsi_get_connections} 5607 5608Show information about all active connections. 5609 5610### Parameters 5611 5612This method has no parameters. 5613 5614### Results 5615 5616Array of objects describing iSCSI connection. 5617 5618Name | Type | Description 5619--------------------------- | --------| ----------- 5620id | number | Index (used for TTT - Target Transfer Tag) 5621cid | number | CID (Connection ID) 5622tsih | number | TSIH (Target Session Identifying Handle) 5623lcore_id | number | Core number on which the iSCSI connection runs 5624initiator_addr | string | Initiator address 5625target_addr | string | Target address 5626target_node_name | string | Target node name (ASCII) without prefix 5627 5628### Example 5629 5630Example request: 5631 5632~~~ 5633{ 5634 "jsonrpc": "2.0", 5635 "method": "iscsi_get_connections", 5636 "id": 1 5637} 5638~~~ 5639 5640Example response: 5641 5642~~~ 5643{ 5644 "jsonrpc": "2.0", 5645 "id": 1, 5646 "result": [ 5647 { 5648 "tsih": 4, 5649 "cid": 0, 5650 "target_node_name": "target1", 5651 "lcore_id": 0, 5652 "initiator_addr": "10.0.0.2", 5653 "target_addr": "10.0.0.1", 5654 "id": 0 5655 } 5656 ] 5657} 5658~~~ 5659 5660## iscsi_target_node_add_lun method {#rpc_iscsi_target_node_add_lun} 5661 5662Add an LUN to an existing iSCSI target node. 5663 5664### Parameters 5665 5666Name | Optional | Type | Description 5667--------------------------- | -------- | --------| ----------- 5668name | Required | string | Target node name (ASCII) 5669bdev_name | Required | string | bdev name to be added as a LUN 5670lun_id | Optional | number | LUN ID (default: first free ID) 5671 5672### Example 5673 5674Example request: 5675 5676~~~ 5677{ 5678 "params": { 5679 "lun_id": 2, 5680 "name": "iqn.2016-06.io.spdk:target1", 5681 "bdev_name": "Malloc0" 5682 }, 5683 "jsonrpc": "2.0", 5684 "method": "iscsi_target_node_add_lun", 5685 "id": 1 5686} 5687~~~ 5688 5689Example response: 5690 5691~~~ 5692{ 5693 "jsonrpc": "2.0", 5694 "id": 1, 5695 "result": true 5696} 5697~~~ 5698 5699## iscsi_target_node_set_redirect method {#rpc_iscsi_target_node_set_redirect} 5700 5701Update redirect portal of the primary portal group for the target node, 5702 5703### Parameters 5704 5705Name | Optional | Type | Description 5706--------------------------- | -------- | --------| ----------- 5707name | Required | string | Target node name (ASCII) 5708pg_tag | Required | number | Existing portal group tag 5709redirect_host | Optional | string | Numeric IP address to which the target node is redirected 5710redirect_port | Optional | string | Numeric TCP port to which the target node is redirected 5711 5712If both redirect_host and redirect_port are omitted, clear the redirect portal. 5713 5714### Example 5715 5716Example request: 5717 5718~~~ 5719{ 5720 "params": { 5721 "name": "iqn.2016-06.io.spdk:target1", 5722 "pg_tag": 1, 5723 "redirect_host": "10.0.0.3", 5724 "redirect_port": "3260" 5725 }, 5726 "jsonrpc": "2.0", 5727 "method": "iscsi_target_node_set_redirect", 5728 "id": 1 5729} 5730~~~ 5731 5732Example response: 5733 5734~~~ 5735{ 5736 "jsonrpc": "2.0", 5737 "id": 1, 5738 "result": true 5739} 5740~~~ 5741 5742## iscsi_target_node_request_logout method {#rpc_iscsi_target_node_request_logout} 5743 5744For the target node, request connections whose portal group tag match to logout, 5745or request all connections to logout if portal group tag is omitted. 5746 5747### Parameters 5748 5749Name | Optional | Type | Description 5750--------------------------- | -------- | --------| ----------- 5751name | Required | string | Target node name (ASCII) 5752pg_tag | Optional | number | Existing portal group tag 5753 5754### Example 5755 5756Example request: 5757 5758~~~ 5759{ 5760 "params": { 5761 "name": "iqn.2016-06.io.spdk:target1", 5762 "pg_tag": 1 5763 }, 5764 "jsonrpc": "2.0", 5765 "method": "iscsi_target_node_request_logout", 5766 "id": 1 5767} 5768~~~ 5769 5770Example response: 5771 5772~~~ 5773{ 5774 "jsonrpc": "2.0", 5775 "id": 1, 5776 "result": true 5777} 5778~~~ 5779 5780# NVMe-oF Target {#jsonrpc_components_nvmf_tgt} 5781 5782## nvmf_create_transport method {#rpc_nvmf_create_transport} 5783 5784Initialize an NVMe-oF transport with the given options. 5785 5786### Parameters 5787 5788Name | Optional | Type | Description 5789--------------------------- | -------- | --------| ----------- 5790trtype | Required | string | Transport type (ex. RDMA) 5791tgt_name | Optional | string | Parent NVMe-oF target name. 5792max_queue_depth | Optional | number | Max number of outstanding I/O per queue 5793max_qpairs_per_ctrlr | Optional | number | Max number of SQ and CQ per controller (deprecated, use max_io_qpairs_per_ctrlr) 5794max_io_qpairs_per_ctrlr | Optional | number | Max number of IO qpairs per controller 5795in_capsule_data_size | Optional | number | Max number of in-capsule data size 5796max_io_size | Optional | number | Max I/O size (bytes) 5797io_unit_size | Optional | number | I/O unit size (bytes) 5798max_aq_depth | Optional | number | Max number of admin cmds per AQ 5799num_shared_buffers | Optional | number | The number of pooled data buffers available to the transport 5800buf_cache_size | Optional | number | The number of shared buffers to reserve for each poll group 5801num_cqe | Optional | number | The number of CQ entires. Only used when no_srq=true (RDMA only) 5802max_srq_depth | Optional | number | The number of elements in a per-thread shared receive queue (RDMA only) 5803no_srq | Optional | boolean | Disable shared receive queue even for devices that support it. (RDMA only) 5804c2h_success | Optional | boolean | Disable C2H success optimization (TCP only) 5805dif_insert_or_strip | Optional | boolean | Enable DIF insert for write I/O and DIF strip for read I/O DIF 5806sock_priority | Optional | number | The socket priority of the connection owned by this transport (TCP only) 5807acceptor_backlog | Optional | number | The number of pending connections allowed in backlog before failing new connection attempts (RDMA only) 5808abort_timeout_sec | Optional | number | Abort execution timeout value, in seconds 5809no_wr_batching | Optional | boolean | Disable work requests batching (RDMA only) 5810 5811### Example 5812 5813Example request: 5814 5815~~~ 5816{ 5817 "jsonrpc": "2.0", 5818 "method": "nvmf_create_transport", 5819 "id": 1, 5820 "params": { 5821 "trtype": "RDMA", 5822 "max_queue_depth": 32 5823 } 5824} 5825~~~ 5826 5827Example response: 5828 5829~~~ 5830{ 5831 "jsonrpc": "2.0", 5832 "id": 1, 5833 "result": true 5834} 5835~~~ 5836 5837## nvmf_get_subsystems method {#rpc_nvmf_get_subsystems} 5838 5839### Parameters 5840 5841Name | Optional | Type | Description 5842--------------------------- | -------- | ------------| ----------- 5843tgt_name | Optional | string | Parent NVMe-oF target name. 5844 5845### Example 5846 5847Example request: 5848 5849~~~ 5850{ 5851 "jsonrpc": "2.0", 5852 "id": 1, 5853 "method": "nvmf_get_subsystems" 5854} 5855~~~ 5856 5857Example response: 5858 5859~~~ 5860{ 5861 "jsonrpc": "2.0", 5862 "id": 1, 5863 "result": [ 5864 { 5865 "nqn": "nqn.2014-08.org.nvmexpress.discovery", 5866 "subtype": "Discovery" 5867 "listen_addresses": [], 5868 "hosts": [], 5869 "allow_any_host": true 5870 }, 5871 { 5872 "nqn": "nqn.2016-06.io.spdk:cnode1", 5873 "subtype": "NVMe", 5874 "listen_addresses": [ 5875 { 5876 "trtype": "RDMA", 5877 "adrfam": "IPv4", 5878 "traddr": "192.168.0.123", 5879 "trsvcid": "4420" 5880 } 5881 ], 5882 "hosts": [ 5883 {"nqn": "nqn.2016-06.io.spdk:host1"} 5884 ], 5885 "allow_any_host": false, 5886 "serial_number": "abcdef", 5887 "model_number": "ghijklmnop", 5888 "namespaces": [ 5889 {"nsid": 1, "name": "Malloc2"}, 5890 {"nsid": 2, "name": "Nvme0n1"} 5891 ] 5892 } 5893 ] 5894} 5895~~~ 5896 5897## nvmf_create_subsystem method {#rpc_nvmf_create_subsystem} 5898 5899Construct an NVMe over Fabrics target subsystem. 5900 5901### Parameters 5902 5903Name | Optional | Type | Description 5904----------------------- | -------- | ----------- | ----------- 5905nqn | Required | string | Subsystem NQN 5906tgt_name | Optional | string | Parent NVMe-oF target name. 5907serial_number | Optional | string | Serial number of virtual controller 5908model_number | Optional | string | Model number of virtual controller 5909max_namespaces | Optional | number | Maximum number of namespaces that can be attached to the subsystem. Default: 0 (Unlimited) 5910allow_any_host | Optional | boolean | Allow any host (`true`) or enforce allowed host list (`false`). Default: `false`. 5911ana_reporting | Optional | boolean | Enable ANA reporting feature (default: `false`). 5912 5913### Example 5914 5915Example request: 5916 5917~~~ 5918{ 5919 "jsonrpc": "2.0", 5920 "id": 1, 5921 "method": "nvmf_create_subsystem", 5922 "params": { 5923 "nqn": "nqn.2016-06.io.spdk:cnode1", 5924 "allow_any_host": false, 5925 "serial_number": "abcdef", 5926 "model_number": "ghijklmnop" 5927 } 5928} 5929~~~ 5930 5931Example response: 5932 5933~~~ 5934{ 5935 "jsonrpc": "2.0", 5936 "id": 1, 5937 "result": true 5938} 5939~~~ 5940 5941## nvmf_delete_subsystem method {#rpc_nvmf_delete_subsystem} 5942 5943Delete an existing NVMe-oF subsystem. 5944 5945### Parameters 5946 5947Parameter | Optional | Type | Description 5948---------------------- | -------- | ----------- | ----------- 5949nqn | Required | string | Subsystem NQN to delete. 5950tgt_name | Optional | string | Parent NVMe-oF target name. 5951 5952### Example 5953 5954Example request: 5955 5956~~~ 5957{ 5958 "jsonrpc": "2.0", 5959 "id": 1, 5960 "method": "nvmf_delete_subsystem", 5961 "params": { 5962 "nqn": "nqn.2016-06.io.spdk:cnode1" 5963 } 5964} 5965~~~ 5966 5967Example response: 5968 5969~~~ 5970{ 5971 "jsonrpc": "2.0", 5972 "id": 1, 5973 "result": true 5974} 5975~~~ 5976 5977## nvmf_subsystem_add_listener method {#rpc_nvmf_subsystem_add_listener} 5978 5979Add a new listen address to an NVMe-oF subsystem. 5980 5981### Parameters 5982 5983Name | Optional | Type | Description 5984----------------------- | -------- | ----------- | ----------- 5985nqn | Required | string | Subsystem NQN 5986tgt_name | Optional | string | Parent NVMe-oF target name. 5987listen_address | Required | object | @ref rpc_nvmf_listen_address object 5988 5989### listen_address {#rpc_nvmf_listen_address} 5990 5991Name | Optional | Type | Description 5992----------------------- | -------- | ----------- | ----------- 5993trtype | Required | string | Transport type ("RDMA") 5994adrfam | Required | string | Address family ("IPv4", "IPv6", "IB", or "FC") 5995traddr | Required | string | Transport address 5996trsvcid | Optional | string | Transport service ID (required for RDMA or TCP) 5997 5998### Example 5999 6000Example request: 6001 6002~~~ 6003{ 6004 "jsonrpc": "2.0", 6005 "id": 1, 6006 "method": "nvmf_subsystem_add_listener", 6007 "params": { 6008 "nqn": "nqn.2016-06.io.spdk:cnode1", 6009 "listen_address": { 6010 "trtype": "RDMA", 6011 "adrfam": "IPv4", 6012 "traddr": "192.168.0.123", 6013 "trsvcid": "4420" 6014 } 6015 } 6016} 6017~~~ 6018 6019Example response: 6020 6021~~~ 6022{ 6023 "jsonrpc": "2.0", 6024 "id": 1, 6025 "result": true 6026} 6027~~~ 6028 6029## nvmf_subsystem_remove_listener method {#rpc_nvmf_subsystem_remove_listener} 6030 6031Remove a listen address from an NVMe-oF subsystem. 6032 6033### Parameters 6034 6035Name | Optional | Type | Description 6036----------------------- | -------- | ----------- | ----------- 6037nqn | Required | string | Subsystem NQN 6038tgt_name | Optional | string | Parent NVMe-oF target name. 6039listen_address | Required | object | @ref rpc_nvmf_listen_address object 6040 6041### Example 6042 6043Example request: 6044 6045~~~ 6046{ 6047 "jsonrpc": "2.0", 6048 "id": 1, 6049 "method": "nvmf_subsystem_remove_listener", 6050 "params": { 6051 "nqn": "nqn.2016-06.io.spdk:cnode1", 6052 "listen_address": { 6053 "trtype": "RDMA", 6054 "adrfam": "IPv4", 6055 "traddr": "192.168.0.123", 6056 "trsvcid": "4420" 6057 } 6058 } 6059} 6060~~~ 6061 6062Example response: 6063 6064~~~ 6065{ 6066 "jsonrpc": "2.0", 6067 "id": 1, 6068 "result": true 6069} 6070~~~ 6071 6072## nvmf_subsystem_listener_set_ana_state method {#rpc_nvmf_subsystem_listener_set_ana_state} 6073 6074Set ANA state of a listener for an NVMe-oF subsystem. 6075 6076### Parameters 6077 6078Name | Optional | Type | Description 6079----------------------- | -------- | ----------- | ----------- 6080nqn | Required | string | Subsystem NQN 6081tgt_name | Optional | string | Parent NVMe-oF target name. 6082listen_address | Required | object | @ref rpc_nvmf_listen_address object 6083ana_state | Required | string | ANA state to set ("optimized", "non_optimized", or "inaccessible") 6084 6085### Example 6086 6087Example request: 6088 6089~~~ 6090{ 6091 "jsonrpc": "2.0", 6092 "id": 1, 6093 "method": "nvmf_subsystem_listener_set_ana_state", 6094 "params": { 6095 "nqn": "nqn.2016-06.io.spdk:cnode1", 6096 "listen_address": { 6097 "trtype": "RDMA", 6098 "adrfam": "IPv4", 6099 "traddr": "192.168.0.123", 6100 "trsvcid": "4420" 6101 }, 6102 "ana_state", "inaccessible" 6103 } 6104} 6105~~~ 6106 6107Example response: 6108 6109~~~ 6110{ 6111 "jsonrpc": "2.0", 6112 "id": 1, 6113 "result": true 6114} 6115~~~ 6116 6117## nvmf_subsystem_add_ns method {#rpc_nvmf_subsystem_add_ns} 6118 6119Add a namespace to a subsystem. The namespace ID is returned as the result. 6120 6121### Parameters 6122 6123Name | Optional | Type | Description 6124----------------------- | -------- | ----------- | ----------- 6125nqn | Required | string | Subsystem NQN 6126namespace | Required | object | @ref rpc_nvmf_namespace object 6127tgt_name | Optional | string | Parent NVMe-oF target name. 6128 6129### namespace {#rpc_nvmf_namespace} 6130 6131Name | Optional | Type | Description 6132----------------------- | -------- | ----------- | ----------- 6133nsid | Optional | number | Namespace ID between 1 and 4294967294, inclusive. Default: Automatically assign NSID. 6134bdev_name | Required | string | Name of bdev to expose as a namespace. 6135nguid | Optional | string | 16-byte namespace globally unique identifier in hexadecimal (e.g. "ABCDEF0123456789ABCDEF0123456789") 6136eui64 | Optional | string | 8-byte namespace EUI-64 in hexadecimal (e.g. "ABCDEF0123456789") 6137uuid | Optional | string | RFC 4122 UUID (e.g. "ceccf520-691e-4b46-9546-34af789907c5") 6138ptpl_file | Optional | string | File path to save/restore persistent reservation information 6139 6140### Example 6141 6142Example request: 6143 6144~~~ 6145{ 6146 "jsonrpc": "2.0", 6147 "id": 1, 6148 "method": "nvmf_subsystem_add_ns", 6149 "params": { 6150 "nqn": "nqn.2016-06.io.spdk:cnode1", 6151 "namespace": { 6152 "nsid": 3, 6153 "bdev_name": "Nvme0n1", 6154 "ptpl_file": "/opt/Nvme0n1PR.json" 6155 } 6156 } 6157} 6158~~~ 6159 6160Example response: 6161 6162~~~ 6163{ 6164 "jsonrpc": "2.0", 6165 "id": 1, 6166 "result": 3 6167} 6168~~~ 6169 6170## nvmf_subsystem_remove_ns method {#rpc_nvmf_subsystem_remove_ns} 6171 6172Remove a namespace from a subsystem. 6173 6174### Parameters 6175 6176Name | Optional | Type | Description 6177----------------------- | -------- | ----------- | ----------- 6178nqn | Required | string | Subsystem NQN 6179nsid | Required | number | Namespace ID 6180tgt_name | Optional | string | Parent NVMe-oF target name. 6181 6182### Example 6183 6184Example request: 6185 6186~~~ 6187{ 6188 "jsonrpc": "2.0", 6189 "id": 1, 6190 "method": "nvmf_subsystem_remove_ns", 6191 "params": { 6192 "nqn": "nqn.2016-06.io.spdk:cnode1", 6193 "nsid": 1 6194 } 6195} 6196~~~ 6197 6198Example response: 6199 6200~~~ 6201{ 6202 "jsonrpc": "2.0", 6203 "id": 1, 6204 "result": true 6205} 6206~~~ 6207 6208## nvmf_subsystem_add_host method {#rpc_nvmf_subsystem_add_host} 6209 6210Add a host NQN to the list of allowed hosts. 6211 6212### Parameters 6213 6214Name | Optional | Type | Description 6215----------------------- | -------- | ----------- | ----------- 6216nqn | Required | string | Subsystem NQN 6217host | Required | string | Host NQN to add to the list of allowed host NQNs 6218tgt_name | Optional | string | Parent NVMe-oF target name. 6219 6220### Example 6221 6222Example request: 6223 6224~~~ 6225{ 6226 "jsonrpc": "2.0", 6227 "id": 1, 6228 "method": "nvmf_subsystem_add_host", 6229 "params": { 6230 "nqn": "nqn.2016-06.io.spdk:cnode1", 6231 "host": "nqn.2016-06.io.spdk:host1" 6232 } 6233} 6234~~~ 6235 6236Example response: 6237 6238~~~ 6239{ 6240 "jsonrpc": "2.0", 6241 "id": 1, 6242 "result": true 6243} 6244~~~ 6245 6246## nvmf_subsystem_remove_host method {#rpc_nvmf_subsystem_remove_host} 6247 6248Remove a host NQN from the list of allowed hosts. 6249 6250### Parameters 6251 6252Name | Optional | Type | Description 6253----------------------- | -------- | ----------- | ----------- 6254nqn | Required | string | Subsystem NQN 6255host | Required | string | Host NQN to remove from the list of allowed host NQNs 6256tgt_name | Optional | string | Parent NVMe-oF target name. 6257 6258### Example 6259 6260Example request: 6261 6262~~~ 6263{ 6264 "jsonrpc": "2.0", 6265 "id": 1, 6266 "method": "nvmf_subsystem_remove_host", 6267 "params": { 6268 "nqn": "nqn.2016-06.io.spdk:cnode1", 6269 "host": "nqn.2016-06.io.spdk:host1" 6270 } 6271} 6272~~~ 6273 6274Example response: 6275 6276~~~ 6277{ 6278 "jsonrpc": "2.0", 6279 "id": 1, 6280 "result": true 6281} 6282~~~ 6283 6284## nvmf_subsystem_allow_any_host method {#rpc_nvmf_subsystem_allow_any_host} 6285 6286Configure a subsystem to allow any host to connect or to enforce the host NQN list. 6287 6288### Parameters 6289 6290Name | Optional | Type | Description 6291----------------------- | -------- | ----------- | ----------- 6292nqn | Required | string | Subsystem NQN 6293allow_any_host | Required | boolean | Allow any host (`true`) or enforce allowed host list (`false`). 6294tgt_name | Optional | string | Parent NVMe-oF target name. 6295 6296### Example 6297 6298Example request: 6299 6300~~~ 6301{ 6302 "jsonrpc": "2.0", 6303 "id": 1, 6304 "method": "nvmf_subsystem_allow_any_host", 6305 "params": { 6306 "nqn": "nqn.2016-06.io.spdk:cnode1", 6307 "allow_any_host": true 6308 } 6309} 6310~~~ 6311 6312Example response: 6313 6314~~~ 6315{ 6316 "jsonrpc": "2.0", 6317 "id": 1, 6318 "result": true 6319} 6320~~~ 6321 6322## nvmf_subsystem_get_controllers {#rpc_nvmf_subsystem_get_controllers} 6323 6324### Parameters 6325 6326Name | Optional | Type | Description 6327----------------------- | -------- | ----------- | ----------- 6328nqn | Required | string | Subsystem NQN 6329tgt_name | Optional | string | Parent NVMe-oF target name. 6330 6331### Example 6332 6333Example request: 6334 6335~~~ 6336{ 6337 "jsonrpc": "2.0", 6338 "id": 1, 6339 "method": "nvmf_subsystem_get_controllers", 6340 "params": { 6341 "nqn": "nqn.2016-06.io.spdk:cnode1" 6342 } 6343} 6344~~~ 6345 6346Example response: 6347 6348~~~ 6349{ 6350 "jsonrpc": "2.0", 6351 "id": 1, 6352 "result": [ 6353 { 6354 "cntlid": 1, 6355 "hostnqn": "nqn.2016-06.io.spdk:host1", 6356 "hostid": "27dad528-6368-41c3-82d3-0b956b49025d", 6357 "num_io_qpairs": 5 6358 } 6359 ] 6360} 6361~~~ 6362 6363## nvmf_subsystem_get_qpairs {#rpc_nvmf_subsystem_get_qpairs} 6364 6365### Parameters 6366 6367Name | Optional | Type | Description 6368----------------------- | -------- | ----------- | ----------- 6369nqn | Required | string | Subsystem NQN 6370tgt_name | Optional | string | Parent NVMe-oF target name. 6371 6372### Example 6373 6374Example request: 6375 6376~~~ 6377{ 6378 "jsonrpc": "2.0", 6379 "id": 1, 6380 "method": "nvmf_subsystem_get_qpairs", 6381 "params": { 6382 "nqn": "nqn.2016-06.io.spdk:cnode1" 6383 } 6384} 6385~~~ 6386 6387Example response: 6388 6389~~~ 6390{ 6391 "jsonrpc": "2.0", 6392 "id": 1, 6393 "result": [ 6394 { 6395 "cntlid": 1, 6396 "qid": 0, 6397 "state": "active", 6398 "listen_address": { 6399 "trtype": "RDMA", 6400 "adrfam": "IPv4", 6401 "traddr": "192.168.0.123", 6402 "trsvcid": "4420" 6403 } 6404 }, 6405 { 6406 "cntlid": 1, 6407 "qid": 1, 6408 "state": "active", 6409 "listen_address": { 6410 "trtype": "RDMA", 6411 "adrfam": "IPv4", 6412 "traddr": "192.168.0.123", 6413 "trsvcid": "4420" 6414 } 6415 } 6416 ] 6417} 6418~~~ 6419 6420## nvmf_subsystem_get_listeners {#rpc_nvmf_subsystem_get_listeners} 6421 6422### Parameters 6423 6424Name | Optional | Type | Description 6425----------------------- | -------- | ----------- | ----------- 6426nqn | Required | string | Subsystem NQN 6427tgt_name | Optional | string | Parent NVMe-oF target name. 6428 6429### Example 6430 6431Example request: 6432 6433~~~ 6434{ 6435 "jsonrpc": "2.0", 6436 "id": 1, 6437 "method": "nvmf_subsystem_get_listeners", 6438 "params": { 6439 "nqn": "nqn.2016-06.io.spdk:cnode1" 6440 } 6441} 6442~~~ 6443 6444Example response: 6445 6446~~~ 6447{ 6448 "jsonrpc": "2.0", 6449 "id": 1, 6450 "result": [ 6451 { 6452 "address": { 6453 "trtype": "RDMA", 6454 "adrfam": "IPv4", 6455 "traddr": "192.168.0.123", 6456 "trsvcid": "4420" 6457 }, 6458 "ana_state": "optimized" 6459 } 6460 ] 6461} 6462~~~ 6463 6464## nvmf_set_max_subsystems {#rpc_nvmf_set_max_subsystems} 6465 6466Set the maximum allowed subsystems for the NVMe-oF target. This RPC may only be called 6467before SPDK subsystems have been initialized. 6468 6469### Parameters 6470 6471Name | Optional | Type | Description 6472----------------------- | -------- | ----------- | ----------- 6473max_subsystems | Required | number | Maximum number of NVMe-oF subsystems 6474 6475### Example 6476 6477Example request: 6478 6479~~~ 6480{ 6481 "jsonrpc": "2.0", 6482 "id": 1, 6483 "method": "nvmf_set_max_subsystems", 6484 "params": { 6485 "max_subsystems": 1024 6486 } 6487} 6488~~~ 6489 6490Example response: 6491 6492~~~ 6493{ 6494 "jsonrpc": "2.0", 6495 "id": 1, 6496 "result": true 6497} 6498~~~ 6499 6500## nvmf_set_config {#rpc_nvmf_set_config} 6501 6502Set global configuration of NVMe-oF target. This RPC may only be called before SPDK subsystems 6503have been initialized. 6504 6505### Parameters 6506 6507Name | Optional | Type | Description 6508----------------------- | -------- | ----------- | ----------- 6509acceptor_poll_rate | Optional | number | Polling interval of the acceptor for incoming connections (microseconds) 6510admin_cmd_passthru | Optional | object | Admin command passthru configuration 6511 6512### admin_cmd_passthru {#spdk_nvmf_admin_passthru_conf} 6513 6514Name | Optional | Type | Description 6515----------------------- | -------- | ----------- | ----------- 6516identify_ctrlr | Required | bool | If true, enables custom identify handler that reports some identify attributes from the underlying NVMe drive 6517 6518### Example 6519 6520Example request: 6521 6522~~~ 6523{ 6524 "jsonrpc": "2.0", 6525 "id": 1, 6526 "method": "nvmf_set_config", 6527 "params": { 6528 "acceptor_poll_rate": 10000 6529 } 6530} 6531~~~ 6532 6533Example response: 6534 6535~~~ 6536{ 6537 "jsonrpc": "2.0", 6538 "id": 1, 6539 "result": true 6540} 6541~~~ 6542 6543## nvmf_get_transports method {#rpc_nvmf_get_transports} 6544 6545### Parameters 6546 6547Name | Optional | Type | Description 6548--------------------------- | -------- | ------------| ----------- 6549tgt_name | Optional | string | Parent NVMe-oF target name. 6550 6551### Example 6552 6553Example request: 6554 6555~~~ 6556{ 6557 "jsonrpc": "2.0", 6558 "id": 1, 6559 "method": "nvmf_get_transports" 6560} 6561~~~ 6562 6563Example response: 6564 6565~~~ 6566{ 6567 "jsonrpc": "2.0", 6568 "id": 1, 6569 "result": [ 6570 { 6571 "type": "RDMA". 6572 "max_queue_depth": 128, 6573 "max_io_qpairs_per_ctrlr": 64, 6574 "in_capsule_data_size": 4096, 6575 "max_io_size": 131072, 6576 "io_unit_size": 131072, 6577 "abort_timeout_sec": 1 6578 } 6579 ] 6580} 6581~~~ 6582 6583## nvmf_get_stats method {#rpc_nvmf_get_stats} 6584 6585Retrieve current statistics of the NVMf subsystem. 6586 6587### Parameters 6588 6589Name | Optional | Type | Description 6590--------------------------- | -------- | ------------| ----------- 6591tgt_name | Optional | string | Parent NVMe-oF target name. 6592 6593### Response 6594 6595The response is an object containing NVMf subsystem statistics. 6596 6597### Example 6598 6599Example request: 6600~~~ 6601{ 6602 "jsonrpc": "2.0", 6603 "method": "nvmf_get_stats", 6604 "id": 1 6605} 6606~~~ 6607 6608Example response: 6609~~~ 6610{ 6611 "jsonrpc": "2.0", 6612 "id": 1, 6613 "result": { 6614 "tick_rate": 2400000000, 6615 "poll_groups": [ 6616 { 6617 "name": "app_thread", 6618 "admin_qpairs": 1, 6619 "io_qpairs": 4, 6620 "pending_bdev_io": 1721, 6621 "transports": [ 6622 { 6623 "trtype": "RDMA", 6624 "pending_data_buffer": 12131888, 6625 "devices": [ 6626 { 6627 "name": "mlx5_1", 6628 "polls": 72284105, 6629 "completions": 0, 6630 "requests": 0, 6631 "request_latency": 0, 6632 "pending_free_request": 0, 6633 "pending_rdma_read": 0, 6634 "pending_rdma_write": 0, 6635 "total_send_wrs": 0, 6636 "send_doorbell_updates": 0, 6637 "total_recv_wrs": 0, 6638 "recv_doorbell_updates": 1 6639 }, 6640 { 6641 "name": "mlx5_0", 6642 "polls": 72284105, 6643 "completions": 15165875, 6644 "requests": 7582935, 6645 "request_latency": 1249323766184, 6646 "pending_free_request": 0, 6647 "pending_rdma_read": 337602, 6648 "pending_rdma_write": 0, 6649 "total_send_wrs": 15165875, 6650 "send_doorbell_updates": 1516587, 6651 "total_recv_wrs": 15165875, 6652 "recv_doorbell_updates": 1516587 6653 } 6654 ] 6655 } 6656 ] 6657 } 6658 ] 6659 } 6660} 6661~~~ 6662 6663# Vhost Target {#jsonrpc_components_vhost_tgt} 6664 6665The following common preconditions need to be met in all target types. 6666 6667Controller name will be used to create UNIX domain socket. This implies that name concatenated with vhost socket 6668directory path needs to be valid UNIX socket name. 6669 6670@ref cpu_mask parameter is used to choose CPU on which pollers will be launched when new initiator is connecting. 6671It must be a subset of application CPU mask. Default value is CPU mask of the application. 6672 6673## vhost_controller_set_coalescing {#rpc_vhost_controller_set_coalescing} 6674 6675Controls interrupt coalescing for specific target. Because `delay_base_us` is used to calculate delay in CPU ticks 6676there is no hardcoded limit for this parameter. Only limitation is that final delay in CPU ticks might not overflow 667732 bit unsigned integer (which is more than 1s @ 4GHz CPU). In real scenarios `delay_base_us` should be much lower 6678than 150us. To disable coalescing set `delay_base_us` to 0. 6679 6680### Parameters 6681 6682Name | Optional | Type | Description 6683----------------------- | -------- | ----------- | ----------- 6684ctrlr | Required | string | Controller name 6685delay_base_us | Required | number | Base (minimum) coalescing time in microseconds 6686iops_threshold | Required | number | Coalescing activation level greater than 0 in IO per second 6687 6688### Example 6689 6690Example request: 6691 6692~~~ 6693{ 6694 "params": { 6695 "iops_threshold": 100000, 6696 "ctrlr": "VhostScsi0", 6697 "delay_base_us": 80 6698 }, 6699 "jsonrpc": "2.0", 6700 "method": "vhost_controller_set_coalescing", 6701 "id": 1 6702} 6703~~~ 6704 6705Example response: 6706 6707~~~ 6708{ 6709 "jsonrpc": "2.0", 6710 "id": 1, 6711 "result": true 6712} 6713~~~ 6714 6715## vhost_create_scsi_controller {#rpc_vhost_create_scsi_controller} 6716 6717Construct vhost SCSI target. 6718 6719### Parameters 6720 6721Name | Optional | Type | Description 6722----------------------- | -------- | ----------- | ----------- 6723ctrlr | Required | string | Controller name 6724cpumask | Optional | string | @ref cpu_mask for this controller 6725 6726### Example 6727 6728Example request: 6729 6730~~~ 6731{ 6732 "params": { 6733 "cpumask": "0x2", 6734 "ctrlr": "VhostScsi0" 6735 }, 6736 "jsonrpc": "2.0", 6737 "method": "vhost_create_scsi_controller", 6738 "id": 1 6739} 6740~~~ 6741 6742Example response: 6743 6744~~~ 6745{ 6746 "jsonrpc": "2.0", 6747 "id": 1, 6748 "result": true 6749} 6750~~~ 6751 6752## vhost_scsi_controller_add_target {#rpc_vhost_scsi_controller_add_target} 6753 6754In vhost target `ctrlr` create SCSI target with ID `scsi_target_num` and add `bdev_name` as LUN 0. 6755 6756### Parameters 6757 6758Name | Optional | Type | Description 6759----------------------- | -------- | ----------- | ----------- 6760ctrlr | Required | string | Controller name 6761scsi_target_num | Required | number | SCSI target ID between 0 and 7 or -1 to use first free ID. 6762bdev_name | Required | string | Name of bdev to expose as a LUN 0 6763 6764### Response 6765 6766SCSI target ID. 6767 6768### Example 6769 6770Example request: 6771 6772~~~ 6773{ 6774 "params": { 6775 "scsi_target_num": 1, 6776 "bdev_name": "Malloc0", 6777 "ctrlr": "VhostScsi0" 6778 }, 6779 "jsonrpc": "2.0", 6780 "method": "vhost_scsi_controller_add_target", 6781 "id": 1 6782} 6783~~~ 6784 6785Example response: 6786 6787~~~ 6788response: 6789{ 6790 "jsonrpc": "2.0", 6791 "id": 1, 6792 "result": 1 6793} 6794~~~ 6795 6796## vhost_scsi_controller_remove_target {#rpc_vhost_scsi_controller_remove_target} 6797 6798Remove SCSI target ID `scsi_target_num` from vhost target `scsi_target_num`. 6799 6800This method will fail if initiator is connected, but doesn't support hot-remove (the `VIRTIO_SCSI_F_HOTPLUG` is not negotiated). 6801 6802### Parameters 6803 6804Name | Optional | Type | Description 6805----------------------- | -------- | ----------- | ----------- 6806ctrlr | Required | string | Controller name 6807scsi_target_num | Required | number | SCSI target ID between 0 and 7 6808 6809### Example 6810 6811Example request: 6812 6813~~~ 6814request: 6815{ 6816 "params": { 6817 "scsi_target_num": 1, 6818 "ctrlr": "VhostScsi0" 6819 }, 6820 "jsonrpc": "2.0", 6821 "method": "vhost_scsi_controller_remove_target", 6822 "id": 1 6823} 6824~~~ 6825 6826Example response: 6827 6828~~~ 6829{ 6830 "jsonrpc": "2.0", 6831 "id": 1, 6832 "result": true 6833} 6834~~~ 6835 6836## vhost_create_blk_controller {#rpc_vhost_create_blk_controller} 6837 6838Create vhost block controller 6839 6840If `readonly` is `true` then vhost block target will be created as read only and fail any write requests. 6841The `VIRTIO_BLK_F_RO` feature flag will be offered to the initiator. 6842 6843### Parameters 6844 6845Name | Optional | Type | Description 6846----------------------- | -------- | ----------- | ----------- 6847ctrlr | Required | string | Controller name 6848bdev_name | Required | string | Name of bdev to expose block device 6849readonly | Optional | boolean | If true, this target will be read only (default: false) 6850cpumask | Optional | string | @ref cpu_mask for this controller 6851 6852### Example 6853 6854Example request: 6855 6856~~~ 6857{ 6858 "params": { 6859 "dev_name": "Malloc0", 6860 "ctrlr": "VhostBlk0" 6861 }, 6862 "jsonrpc": "2.0", 6863 "method": "vhost_create_blk_controller", 6864 "id": 1 6865} 6866~~~ 6867 6868Example response: 6869 6870~~~ 6871{ 6872 "jsonrpc": "2.0", 6873 "id": 1, 6874 "result": true 6875} 6876~~~ 6877 6878## vhost_get_controllers {#rpc_vhost_get_controllers} 6879 6880Display information about all or specific vhost controller(s). 6881 6882### Parameters 6883 6884The user may specify no parameters in order to list all controllers, or a controller may be 6885specified by name. 6886 6887Name | Optional | Type | Description 6888----------------------- | -------- | ----------- | ----------- 6889name | Optional | string | Vhost controller name 6890 6891### Response {#rpc_vhost_get_controllers_response} 6892 6893Response is an array of objects describing requested controller(s). Common fields are: 6894 6895Name | Type | Description 6896----------------------- | ----------- | ----------- 6897ctrlr | string | Controller name 6898cpumask | string | @ref cpu_mask of this controller 6899delay_base_us | number | Base (minimum) coalescing time in microseconds (0 if disabled) 6900iops_threshold | number | Coalescing activation level 6901backend_specific | object | Backend specific informations 6902 6903### Vhost block {#rpc_vhost_get_controllers_blk} 6904 6905`backend_specific` contains one `block` object of type: 6906 6907Name | Type | Description 6908----------------------- | ----------- | ----------- 6909bdev | string | Backing bdev name or Null if bdev is hot-removed 6910readonly | boolean | True if controllers is readonly, false otherwise 6911 6912### Vhost SCSI {#rpc_vhost_get_controllers_scsi} 6913 6914`backend_specific` contains `scsi` array of following objects: 6915 6916Name | Type | Description 6917----------------------- | ----------- | ----------- 6918target_name | string | Name of this SCSI target 6919id | number | Unique SPDK global SCSI target ID 6920scsi_dev_num | number | SCSI target ID initiator will see when scanning this controller 6921luns | array | array of objects describing @ref rpc_vhost_get_controllers_scsi_luns 6922 6923### Vhost SCSI LUN {#rpc_vhost_get_controllers_scsi_luns} 6924 6925Object of type: 6926 6927Name | Type | Description 6928----------------------- | ----------- | ----------- 6929id | number | SCSI LUN ID 6930bdev_name | string | Backing bdev name 6931 6932### Vhost NVMe {#rpc_vhost_get_controllers_nvme} 6933 6934`backend_specific` contains `namespaces` array of following objects: 6935 6936Name | Type | Description 6937----------------------- | ----------- | ----------- 6938nsid | number | Namespace ID 6939bdev | string | Backing bdev name 6940 6941### Example 6942 6943Example request: 6944 6945~~~ 6946{ 6947 "jsonrpc": "2.0", 6948 "method": "vhost_get_controllers", 6949 "id": 1 6950} 6951~~~ 6952 6953Example response: 6954 6955~~~ 6956{ 6957 "jsonrpc": "2.0", 6958 "id": 1, 6959 "result": [ 6960 { 6961 "cpumask": "0x2", 6962 "backend_specific": { 6963 "block": { 6964 "readonly": false, 6965 "bdev": "Malloc0" 6966 } 6967 }, 6968 "iops_threshold": 60000, 6969 "ctrlr": "VhostBlk0", 6970 "delay_base_us": 100 6971 }, 6972 { 6973 "cpumask": "0x2", 6974 "backend_specific": { 6975 "scsi": [ 6976 { 6977 "target_name": "Target 2", 6978 "luns": [ 6979 { 6980 "id": 0, 6981 "bdev_name": "Malloc1" 6982 } 6983 ], 6984 "id": 0, 6985 "scsi_dev_num": 2 6986 }, 6987 { 6988 "target_name": "Target 5", 6989 "luns": [ 6990 { 6991 "id": 0, 6992 "bdev_name": "Malloc2" 6993 } 6994 ], 6995 "id": 1, 6996 "scsi_dev_num": 5 6997 } 6998 ] 6999 }, 7000 "iops_threshold": 60000, 7001 "ctrlr": "VhostScsi0", 7002 "delay_base_us": 0 7003 }, 7004 { 7005 "cpumask": "0x2", 7006 "backend_specific": { 7007 "namespaces": [ 7008 { 7009 "bdev": "Malloc3", 7010 "nsid": 1 7011 }, 7012 { 7013 "bdev": "Malloc4", 7014 "nsid": 2 7015 } 7016 ] 7017 }, 7018 "iops_threshold": 60000, 7019 "ctrlr": "VhostNvme0", 7020 "delay_base_us": 0 7021 } 7022 ] 7023} 7024~~~ 7025 7026## vhost_delete_controller {#rpc_vhost_delete_controller} 7027 7028Remove vhost target. 7029 7030This call will fail if there is an initiator connected or there is at least one SCSI target configured in case of 7031vhost SCSI target. In the later case please remove all SCSI targets first using @ref rpc_vhost_scsi_controller_remove_target. 7032 7033### Parameters 7034 7035Name | Optional | Type | Description 7036----------------------- | -------- | ----------- | ----------- 7037ctrlr | Required | string | Controller name 7038 7039### Example 7040 7041Example request: 7042 7043~~~ 7044{ 7045 "params": { 7046 "ctrlr": "VhostNvme0" 7047 }, 7048 "jsonrpc": "2.0", 7049 "method": "vhost_delete_controller", 7050 "id": 1 7051} 7052~~~ 7053 7054Example response: 7055 7056~~~ 7057{ 7058 "jsonrpc": "2.0", 7059 "id": 1, 7060 "result": true 7061} 7062~~~ 7063 7064# Logical Volume {#jsonrpc_components_lvol} 7065 7066Identification of logical volume store and logical volume is explained first. 7067 7068A logical volume store has a UUID and a name for its identification. 7069The UUID is generated on creation and it can be used as a unique identifier. 7070The name is specified on creation and can be renamed. 7071Either UUID or name is used to access logical volume store in RPCs. 7072 7073A logical volume has a UUID and a name for its identification. 7074The UUID of the logical volume is generated on creation and it can be unique identifier. 7075The alias of the logical volume takes the format _lvs_name/lvol_name_ where: 7076 7077* _lvs_name_ is the name of the logical volume store. 7078* _lvol_name_ is specified on creation and can be renamed. 7079 7080## bdev_lvol_create_lvstore {#rpc_bdev_lvol_create_lvstore} 7081 7082Construct a logical volume store. 7083 7084### Parameters 7085 7086Name | Optional | Type | Description 7087----------------------- | -------- | ----------- | ----------- 7088bdev_name | Required | string | Bdev on which to construct logical volume store 7089lvs_name | Required | string | Name of the logical volume store to create 7090cluster_sz | Optional | number | Cluster size of the logical volume store in bytes 7091clear_method | Optional | string | Change clear method for data region. Available: none, unmap (default), write_zeroes 7092 7093### Response 7094 7095UUID of the created logical volume store is returned. 7096 7097### Example 7098 7099Example request: 7100 7101~~~ 7102{ 7103 "jsonrpc": "2.0", 7104 "id": 1, 7105 "method": "bdev_lvol_create_lvstore", 7106 "params": { 7107 "lvs_name": "LVS0", 7108 "bdev_name": "Malloc0" 7109 "clear_method": "write_zeroes" 7110 } 7111} 7112~~~ 7113 7114Example response: 7115 7116~~~ 7117{ 7118 "jsonrpc": "2.0", 7119 "id": 1, 7120 "result": "a9959197-b5e2-4f2d-8095-251ffb6985a5" 7121} 7122~~~ 7123 7124## bdev_lvol_delete_lvstore {#rpc_bdev_lvol_delete_lvstore} 7125 7126Destroy a logical volume store. 7127 7128### Parameters 7129 7130Name | Optional | Type | Description 7131----------------------- | -------- | ----------- | ----------- 7132uuid | Optional | string | UUID of the logical volume store to destroy 7133lvs_name | Optional | string | Name of the logical volume store to destroy 7134 7135Either uuid or lvs_name must be specified, but not both. 7136 7137### Example 7138 7139Example request: 7140 7141~~~ 7142{ 7143 "jsonrpc": "2.0", 7144 "method": "bdev_lvol_delete_lvstore", 7145 "id": 1 7146 "params": { 7147 "uuid": "a9959197-b5e2-4f2d-8095-251ffb6985a5" 7148 } 7149} 7150~~~ 7151 7152Example response: 7153 7154~~~ 7155{ 7156 "jsonrpc": "2.0", 7157 "id": 1, 7158 "result": true 7159} 7160~~~ 7161 7162## bdev_lvol_get_lvstores {#rpc_bdev_lvol_get_lvstores} 7163 7164Get a list of logical volume stores. 7165 7166### Parameters 7167 7168Name | Optional | Type | Description 7169----------------------- | -------- | ----------- | ----------- 7170uuid | Optional | string | UUID of the logical volume store to retrieve information about 7171lvs_name | Optional | string | Name of the logical volume store to retrieve information about 7172 7173Either uuid or lvs_name may be specified, but not both. 7174If both uuid and lvs_name are omitted, information about all logical volume stores is returned. 7175 7176### Example 7177 7178Example request: 7179 7180~~~ 7181{ 7182 "jsonrpc": "2.0", 7183 "method": "bdev_lvol_get_lvstores", 7184 "id": 1, 7185 "params": { 7186 "lvs_name": "LVS0" 7187 } 7188} 7189~~~ 7190 7191Example response: 7192 7193~~~ 7194{ 7195 "jsonrpc": "2.0", 7196 "id": 1, 7197 "result": [ 7198 { 7199 "uuid": "a9959197-b5e2-4f2d-8095-251ffb6985a5", 7200 "base_bdev": "Malloc0", 7201 "free_clusters": 31, 7202 "cluster_size": 4194304, 7203 "total_data_clusters": 31, 7204 "block_size": 4096, 7205 "name": "LVS0" 7206 } 7207 ] 7208} 7209~~~ 7210 7211## bdev_lvol_rename_lvstore {#rpc_bdev_lvol_rename_lvstore} 7212 7213Rename a logical volume store. 7214 7215### Parameters 7216 7217Name | Optional | Type | Description 7218----------------------- | -------- | ----------- | ----------- 7219old_name | Required | string | Existing logical volume store name 7220new_name | Required | string | New logical volume store name 7221 7222### Example 7223 7224Example request: 7225 7226~~~ 7227{ 7228 "jsonrpc": "2.0", 7229 "method": "bdev_lvol_rename_lvstore", 7230 "id": 1, 7231 "params": { 7232 "old_name": "LVS0", 7233 "new_name": "LVS2" 7234 } 7235} 7236~~~ 7237 7238Example response: 7239 7240~~~ 7241{ 7242 "jsonrpc": "2.0", 7243 "id": 1, 7244 "result": true 7245} 7246~~~ 7247 7248## bdev_lvol_create {#rpc_bdev_lvol_create} 7249 7250Create a logical volume on a logical volume store. 7251 7252### Parameters 7253 7254Name | Optional | Type | Description 7255----------------------- | -------- | ----------- | ----------- 7256lvol_name | Required | string | Name of logical volume to create 7257size | Required | number | Desired size of logical volume in bytes 7258thin_provision | Optional | boolean | True to enable thin provisioning 7259uuid | Optional | string | UUID of logical volume store to create logical volume on 7260lvs_name | Optional | string | Name of logical volume store to create logical volume on 7261clear_method | Optional | string | Change default data clusters clear method. Available: none, unmap, write_zeroes 7262 7263Size will be rounded up to a multiple of cluster size. Either uuid or lvs_name must be specified, but not both. 7264lvol_name will be used in the alias of the created logical volume. 7265 7266### Response 7267 7268UUID of the created logical volume is returned. 7269 7270### Example 7271 7272Example request: 7273 7274~~~ 7275{ 7276 "jsonrpc": "2.0", 7277 "method": "bdev_lvol_create", 7278 "id": 1, 7279 "params": { 7280 "lvol_name": "LVOL0", 7281 "size": 1048576, 7282 "lvs_name": "LVS0", 7283 "clear_method": "unmap", 7284 "thin_provision": true 7285 } 7286} 7287~~~ 7288 7289Example response: 7290 7291~~~ 7292{ 7293 "jsonrpc": "2.0", 7294 "id": 1, 7295 "result": "1b38702c-7f0c-411e-a962-92c6a5a8a602" 7296} 7297~~~ 7298 7299## bdev_lvol_snapshot {#rpc_bdev_lvol_snapshot} 7300 7301Capture a snapshot of the current state of a logical volume. 7302 7303### Parameters 7304 7305Name | Optional | Type | Description 7306----------------------- | -------- | ----------- | ----------- 7307lvol_name | Required | string | UUID or alias of the logical volume to create a snapshot from 7308snapshot_name | Required | string | Name for the newly created snapshot 7309 7310### Response 7311 7312UUID of the created logical volume snapshot is returned. 7313 7314### Example 7315 7316Example request: 7317 7318~~~ 7319{ 7320 "jsonrpc": "2.0", 7321 "method": "bdev_lvol_snapshot", 7322 "id": 1, 7323 "params": { 7324 "lvol_name": "1b38702c-7f0c-411e-a962-92c6a5a8a602", 7325 "snapshot_name": "SNAP1" 7326 } 7327} 7328~~~ 7329 7330Example response: 7331 7332~~~ 7333{ 7334 "jsonrpc": "2.0", 7335 "id": 1, 7336 "result": "cc8d7fdf-7865-4d1f-9fc6-35da8e368670" 7337} 7338~~~ 7339 7340## bdev_lvol_clone {#rpc_bdev_lvol_clone} 7341 7342Create a logical volume based on a snapshot. 7343 7344### Parameters 7345 7346Name | Optional | Type | Description 7347----------------------- | -------- | ----------- | ----------- 7348snapshot_name | Required | string | UUID or alias of the snapshot to clone 7349clone_name | Required | string | Name for the logical volume to create 7350 7351### Response 7352 7353UUID of the created logical volume clone is returned. 7354 7355### Example 7356 7357Example request: 7358 7359~~~ 7360{ 7361 "jsonrpc": "2.0" 7362 "method": "bdev_lvol_clone", 7363 "id": 1, 7364 "params": { 7365 "snapshot_name": "cc8d7fdf-7865-4d1f-9fc6-35da8e368670", 7366 "clone_name": "CLONE1" 7367 } 7368} 7369~~~ 7370 7371Example response: 7372 7373~~~ 7374{ 7375 "jsonrpc": "2.0", 7376 "id": 1, 7377 "result": "8d87fccc-c278-49f0-9d4c-6237951aca09" 7378} 7379~~~ 7380 7381## bdev_lvol_rename {#rpc_bdev_lvol_rename} 7382 7383Rename a logical volume. New name will rename only the alias of the logical volume. 7384 7385### Parameters 7386 7387Name | Optional | Type | Description 7388----------------------- | -------- | ----------- | ----------- 7389old_name | Required | string | UUID or alias of the existing logical volume 7390new_name | Required | string | New logical volume name 7391 7392### Example 7393 7394Example request: 7395 7396~~~ 7397{ 7398 "jsonrpc": "2.0", 7399 "method": "bdev_lvol_rename", 7400 "id": 1, 7401 "params": { 7402 "old_name": "067df606-6dbc-4143-a499-0d05855cb3b8", 7403 "new_name": "LVOL2" 7404 } 7405} 7406~~~ 7407 7408Example response: 7409 7410~~~ 7411{ 7412 "jsonrpc": "2.0", 7413 "id": 1, 7414 "result": true 7415} 7416~~~ 7417 7418## bdev_lvol_resize {#rpc_bdev_lvol_resize} 7419 7420Resize a logical volume. 7421 7422### Parameters 7423 7424Name | Optional | Type | Description 7425----------------------- | -------- | ----------- | ----------- 7426name | Required | string | UUID or alias of the logical volume to resize 7427size | Required | number | Desired size of the logical volume in bytes 7428 7429### Example 7430 7431Example request: 7432 7433~~~ 7434{ 7435 "jsonrpc": "2.0", 7436 "method": "bdev_lvol_resize", 7437 "id": 1, 7438 "params": { 7439 "name": "51638754-ca16-43a7-9f8f-294a0805ab0a", 7440 "size": 2097152 7441 } 7442} 7443~~~ 7444 7445Example response: 7446 7447~~~ 7448{ 7449 "jsonrpc": "2.0", 7450 "id": 1, 7451 "result": true 7452} 7453~~~ 7454 7455## bdev_lvol_set_read_only{#rpc_bdev_lvol_set_read_only} 7456 7457Mark logical volume as read only. 7458 7459### Parameters 7460 7461Name | Optional | Type | Description 7462----------------------- | -------- | ----------- | ----------- 7463name | Required | string | UUID or alias of the logical volume to set as read only 7464 7465### Example 7466 7467Example request: 7468 7469~~~ 7470{ 7471 "jsonrpc": "2.0", 7472 "method": "bdev_lvol_set_read_only", 7473 "id": 1, 7474 "params": { 7475 "name": "51638754-ca16-43a7-9f8f-294a0805ab0a", 7476 } 7477} 7478~~~ 7479 7480Example response: 7481 7482~~~ 7483{ 7484 "jsonrpc": "2.0", 7485 "id": 1, 7486 "result": true 7487} 7488~~~ 7489 7490## bdev_lvol_delete {#rpc_bdev_lvol_delete} 7491 7492Destroy a logical volume. 7493 7494### Parameters 7495 7496Name | Optional | Type | Description 7497----------------------- | -------- | ----------- | ----------- 7498name | Required | string | UUID or alias of the logical volume to destroy 7499 7500### Example 7501 7502Example request: 7503 7504~~~ 7505{ 7506 "jsonrpc": "2.0", 7507 "method": "bdev_lvol_delete", 7508 "id": 1, 7509 "params": { 7510 "name": "51638754-ca16-43a7-9f8f-294a0805ab0a" 7511 } 7512} 7513~~~ 7514 7515Example response: 7516 7517~~~ 7518{ 7519 "jsonrpc": "2.0", 7520 "id": 1, 7521 "result": true 7522} 7523~~~ 7524 7525## bdev_lvol_inflate {#rpc_bdev_lvol_inflate} 7526 7527Inflate a logical volume. All unallocated clusters are allocated and copied from the parent or zero filled if not allocated in the parent. Then all dependencies on the parent are removed. 7528 7529### Parameters 7530 7531Name | Optional | Type | Description 7532----------------------- | -------- | ----------- | ----------- 7533name | Required | string | UUID or alias of the logical volume to inflate 7534 7535### Example 7536 7537Example request: 7538 7539~~~ 7540{ 7541 "jsonrpc": "2.0", 7542 "method": "bdev_lvol_inflate", 7543 "id": 1, 7544 "params": { 7545 "name": "8d87fccc-c278-49f0-9d4c-6237951aca09" 7546 } 7547} 7548~~~ 7549 7550Example response: 7551 7552~~~ 7553{ 7554 "jsonrpc": "2.0", 7555 "id": 1, 7556 "result": true 7557} 7558~~~ 7559 7560## bdev_lvol_decouple_parent {#rpc_bdev_lvol_decouple_parent} 7561 7562Decouple the parent of a logical volume. For unallocated clusters which is allocated in the parent, they are allocated and copied from the parent, but for unallocated clusters which is thin provisioned in the parent, they are kept thin provisioned. Then all dependencies on the parent are removed. 7563 7564### Parameters 7565 7566Name | Optional | Type | Description 7567----------------------- | -------- | ----------- | ----------- 7568name | Required | string | UUID or alias of the logical volume to decouple the parent of it 7569 7570### Example 7571 7572Example request: 7573 7574~~~ 7575{ 7576 "jsonrpc": "2.0", 7577 "method": "bdev_lvol_decouple_parent", 7578 "id": 1. 7579 "params": { 7580 "name": "8d87fccc-c278-49f0-9d4c-6237951aca09" 7581 } 7582} 7583~~~ 7584 7585Example response: 7586 7587~~~ 7588{ 7589 "jsonrpc": "2.0", 7590 "id": 1, 7591 "result": true 7592} 7593~~~ 7594 7595# RAID 7596 7597## bdev_raid_get_bdevs {#rpc_bdev_raid_get_bdevs} 7598 7599This is used to list all the raid bdev names based on the input category requested. Category should be one 7600of 'all', 'online', 'configuring' or 'offline'. 'all' means all the raid bdevs whether they are online or 7601configuring or offline. 'online' is the raid bdev which is registered with bdev layer. 'configuring' is 7602the raid bdev which does not have full configuration discovered yet. 'offline' is the raid bdev which is 7603not registered with bdev as of now and it has encountered any error or user has requested to offline 7604the raid bdev. 7605 7606### Parameters 7607 7608Name | Optional | Type | Description 7609----------------------- | -------- | ----------- | ----------- 7610category | Required | string | all or online or configuring or offline 7611 7612### Example 7613 7614Example request: 7615 7616~~~ 7617{ 7618 "jsonrpc": "2.0", 7619 "method": "bdev_raid_get_bdevs", 7620 "id": 1, 7621 "params": { 7622 "category": "all" 7623 } 7624} 7625~~~ 7626 7627Example response: 7628 7629~~~ 7630{ 7631 "jsonrpc": "2.0", 7632 "id": 1, 7633 "result": [ 7634 "Raid0" 7635 ] 7636} 7637~~~ 7638 7639## bdev_raid_create {#rpc_bdev_raid_create} 7640 7641Constructs new RAID bdev. 7642 7643### Parameters 7644 7645Name | Optional | Type | Description 7646----------------------- | -------- | ----------- | ----------- 7647name | Required | string | RAID bdev name 7648strip_size_kb | Required | number | Strip size in KB 7649raid_level | Required | string | RAID level 7650base_bdevs | Required | string | Base bdevs name, whitespace separated list in quotes 7651 7652### Example 7653 7654Example request: 7655 7656~~~ 7657{ 7658 "jsonrpc": "2.0", 7659 "method": "bdev_raid_create", 7660 "id": 1, 7661 "params": { 7662 "name": "Raid0", 7663 "raid_level": "0", 7664 "base_bdevs": [ 7665 "Malloc0", 7666 "Malloc1", 7667 "Malloc2", 7668 "Malloc3" 7669 ], 7670 "strip_size": 4096 7671 } 7672} 7673~~~ 7674 7675Example response: 7676 7677~~~ 7678{ 7679 "jsonrpc": "2.0", 7680 "id": 1, 7681 "result": true 7682} 7683~~~ 7684 7685## bdev_raid_delete {#rpc_bdev_raid_delete} 7686 7687Removes RAID bdev. 7688 7689### Parameters 7690 7691Name | Optional | Type | Description 7692----------------------- | -------- | ----------- | ----------- 7693name | Required | string | RAID bdev name 7694 7695### Example 7696 7697Example request: 7698 7699~~~ 7700{ 7701 "jsonrpc": "2.0", 7702 "method": "bdev_raid_delete", 7703 "id": 1, 7704 "params": { 7705 "name": "Raid0" 7706 } 7707} 7708~~~ 7709 7710Example response: 7711 7712~~~ 7713{ 7714 "jsonrpc": "2.0", 7715 "id": 1, 7716 "result": true 7717} 7718~~~ 7719 7720# SPLIT 7721 7722## bdev_split_create {#rpc_bdev_split_create} 7723 7724This is used to split an underlying block device and create several smaller equal-sized vbdevs. 7725 7726### Parameters 7727 7728Name | Optional | Type | Description 7729----------------------- | -------- | ----------- | ----------- 7730base_bdev | Required | string | base bdev name 7731split_count | Required | number | number of splits 7732split_size_mb | Optional | number | size in MB to restrict the size 7733 7734### Example 7735 7736Example request: 7737 7738~~~ 7739{ 7740 "jsonrpc": "2.0", 7741 "method": "bdev_split_create", 7742 "id": 1, 7743 "params": { 7744 "base_bdev": "Malloc0", 7745 "split_count": 4 7746 } 7747} 7748~~~ 7749 7750Example response: 7751 7752~~~ 7753{ 7754 "jsonrpc": "2.0", 7755 "id": 1, 7756 "result": [ 7757 "Malloc0p0", 7758 "Malloc0p1", 7759 "Malloc0p2", 7760 "Malloc0p3" 7761 ] 7762} 7763~~~ 7764 7765## bdev_split_delete {#rpc_bdev_split_delete} 7766 7767This is used to remove the split vbdevs. 7768 7769### Parameters 7770 7771Name | Optional | Type | Description 7772----------------------- | -------- | ----------- | ----------- 7773base_bdev | Required | string | base bdev name 7774 7775### Example 7776 7777Example request: 7778 7779~~~ 7780{ 7781 "jsonrpc": "2.0", 7782 "method": "bdev_split_delete", 7783 "id": 1, 7784 "params": { 7785 "base_bdev": "Malloc0" 7786 } 7787} 7788~~~ 7789 7790Example response: 7791 7792~~~ 7793{ 7794 "jsonrpc": "2.0", 7795 "id": 1, 7796 "result": true 7797} 7798~~~ 7799 7800# Uring 7801 7802## bdev_uring_create {#rpc_bdev_uring_create} 7803 7804Create a bdev with io_uring backend. 7805 7806### Parameters 7807 7808Name | Optional | Type | Description 7809----------------------- | -------- | ----------- | ----------- 7810filename | Required | string | path to device or file (ex: /dev/nvme0n1) 7811name | Required | string | name of bdev 7812block_size | Optional | number | block size of device (If omitted, get the block size from the file) 7813 7814### Example 7815 7816Example request: 7817 7818~~~ 7819{ 7820 "jsonrpc": "2.0", 7821 "method": "bdev_uring_create", 7822 "id": 1, 7823 "params": { 7824 "name": "bdev_u0", 7825 "filename": "/dev/nvme0n1", 7826 "block_size": 512 7827 } 7828} 7829~~~ 7830 7831Example response: 7832 7833~~~ 7834{ 7835 "jsonrpc": "2.0", 7836 "id": 1, 7837 "result": "bdev_u0" 7838} 7839~~~ 7840 7841## bdev_uring_delete {#rpc_bdev_uring_delete} 7842 7843Remove a uring bdev. 7844 7845### Parameters 7846 7847Name | Optional | Type | Description 7848----------------------- | -------- | ----------- | ----------- 7849name | Required | string | name of uring bdev to delete 7850 7851### Example 7852 7853Example request: 7854 7855~~~ 7856{ 7857 "jsonrpc": "2.0", 7858 "method": "bdev_uring_delete", 7859 "id": 1, 7860 "params": { 7861 "name": "bdev_u0" 7862 } 7863} 7864~~~ 7865 7866Example response: 7867 7868~~~ 7869{ 7870 "jsonrpc": "2.0", 7871 "id": 1, 7872 "result": true 7873} 7874~~~ 7875 7876# OPAL 7877 7878## bdev_nvme_opal_init {#rpc_bdev_nvme_opal_init} 7879 7880This is used to initialize OPAL of a given NVMe ctrlr, including taking ownership and activating. 7881 7882### Parameters 7883 7884Name | Optional | Type | Description 7885----------------------- | -------- | ----------- | ----------- 7886nvme_ctrlr_name | Required | string | name of nvme ctrlr 7887password | Required | string | admin password of OPAL 7888 7889### Example 7890 7891Example request: 7892 7893~~~ 7894{ 7895 "jsonrpc": "2.0", 7896 "method": "bdev_nvme_opal_init", 7897 "id": 1, 7898 "params": { 7899 "nvme_ctrlr_name": "nvme0", 7900 "password": "*****" 7901 } 7902} 7903~~~ 7904 7905Example response: 7906 7907~~~ 7908{ 7909 "jsonrpc": "2.0", 7910 "id": 1, 7911 "result": true 7912} 7913~~~ 7914 7915## bdev_nvme_opal_revert {#rpc_bdev_nvme_opal_revert} 7916 7917This is used to revert OPAL to its factory settings. Erase all user configuration and data. 7918 7919### Parameters 7920 7921Name | Optional | Type | Description 7922----------------------- | -------- | ----------- | ----------- 7923nvme_ctrlr_name | Required | string | name of nvme ctrlr 7924password | Required | string | admin password of OPAL 7925 7926### Example 7927 7928Example request: 7929 7930~~~ 7931{ 7932 "jsonrpc": "2.0", 7933 "method": "bdev_nvme_opal_revert", 7934 "id": 1, 7935 "params": { 7936 "nvme_ctrlr_name": "nvme0", 7937 "password": "*****" 7938 } 7939} 7940~~~ 7941 7942Example response: 7943 7944~~~ 7945{ 7946 "jsonrpc": "2.0", 7947 "id": 1, 7948 "result": true 7949} 7950~~~ 7951 7952## bdev_opal_create {#rpc_bdev_opal_create} 7953 7954This is used to create an OPAL virtual bdev. 7955 7956### Parameters 7957 7958Name | Optional | Type | Description 7959----------------------- | -------- | ----------- | ----------- 7960nvme_ctrlr_name | Required | string | name of nvme ctrlr that supports OPAL 7961nsid | Required | number | namespace ID 7962locking_range_id | Required | number | OPAL locking range ID 7963range_start | Required | number | locking range start LBA 7964range_length | Required | number | locking range length 7965password | Required | string | admin password of OPAL 7966 7967### Response 7968 7969The response is the name of created OPAL virtual bdev. 7970 7971### Example 7972 7973Example request: 7974 7975~~~ 7976{ 7977 "jsonrpc": "2.0", 7978 "method": "bdev_opal_create", 7979 "id": 1, 7980 "params": { 7981 "nvme_ctrlr_name": "nvme0", 7982 "nsid": 1, 7983 "locking_range_id": 1, 7984 "range_start": 0, 7985 "range_length": 4096, 7986 "password": "*****" 7987 } 7988} 7989~~~ 7990 7991Example response: 7992 7993~~~ 7994{ 7995 "jsonrpc": "2.0", 7996 "id": 1, 7997 "result": "nvme0n1r1" 7998} 7999~~~ 8000 8001## bdev_opal_get_info {#rpc_bdev_opal_get_info} 8002 8003This is used to get information of a given OPAL bdev. 8004 8005### Parameters 8006 8007Name | Optional | Type | Description 8008----------------------- | -------- | ----------- | ----------- 8009bdev_name | Required | string | name of OPAL vbdev 8010password | Required | string | admin password 8011 8012### Response 8013 8014The response is the locking info of OPAL virtual bdev. 8015 8016### Example 8017 8018Example request: 8019 8020~~~ 8021{ 8022 "jsonrpc": "2.0", 8023 "method": "bdev_opal_get_info", 8024 "id": 1, 8025 "params": { 8026 "bdev_name": "nvme0n1r1", 8027 "password": "*****" 8028 } 8029} 8030~~~ 8031 8032Example response: 8033 8034~~~ 8035{ 8036 "jsonrpc": "2.0", 8037 "id": 1, 8038 "result": { 8039 "name": "nvme0n1r1", 8040 "range_start": 0, 8041 "range_length": 4096, 8042 "read_lock_enabled": true, 8043 "write_lock_enabled": true, 8044 "read_locked": false, 8045 "write_locked": false 8046 } 8047} 8048~~~ 8049 8050## bdev_opal_delete {#rpc_bdev_opal_delete} 8051 8052This is used to delete OPAL vbdev. 8053 8054### Parameters 8055 8056Name | Optional | Type | Description 8057----------------------- | -------- | ----------- | ----------- 8058bdev_name | Required | string | name of OPAL vbdev 8059password | Required | string | admin password 8060 8061### Example 8062 8063Example request: 8064 8065~~~ 8066{ 8067 "jsonrpc": "2.0", 8068 "method": "bdev_opal_delete", 8069 "id": 1, 8070 "params": { 8071 "bdev_name": "nvme0n1r1", 8072 "password": "*****" 8073 } 8074} 8075~~~ 8076 8077Example response: 8078 8079~~~ 8080{ 8081 "jsonrpc": "2.0", 8082 "id": 1, 8083 "result": true 8084} 8085~~~ 8086 8087## bdev_opal_new_user {#rpc_bdev_opal_new_user} 8088 8089This enables a new user to the specified opal bdev so that the user can lock/unlock the bdev. 8090Recalling this for the same opal bdev, only the newest user will have the privilege. 8091 8092### Parameters 8093 8094Name | Optional | Type | Description 8095----------------------- | -------- | ----------- | ----------- 8096bdev_name | Required | string | name of OPAL vbdev 8097admin_password | Required | string | admin password 8098user_id | Required | number | user ID 8099user_password | Required | string | user password 8100 8101### Example 8102 8103Example request: 8104 8105~~~ 8106{ 8107 "jsonrpc": "2.0", 8108 "method": "bdev_opal_new_user", 8109 "id": 1, 8110 "params": { 8111 "bdev_name": "nvme0n1r1", 8112 "admin_password": "*****", 8113 "user_id": "1", 8114 "user_password": "********" 8115 } 8116} 8117~~~ 8118 8119Example response: 8120 8121~~~ 8122{ 8123 "jsonrpc": "2.0", 8124 "id": 1, 8125 "result": true 8126} 8127~~~ 8128 8129## bdev_opal_set_lock_state {#rpc_bdev_opal_set_lock_state} 8130 8131This is used to lock/unlock specific opal bdev providing user ID and password. 8132 8133### Parameters 8134 8135Name | Optional | Type | Description 8136----------------------- | -------- | ----------- | ----------- 8137bdev_name | Required | string | name of OPAL vbdev 8138user_id | Required | number | user ID 8139password | Required | string | user password 8140lock_state | Required | string | lock state 8141 8142### Example 8143 8144Example request: 8145 8146~~~ 8147{ 8148 "jsonrpc": "2.0", 8149 "method": "bdev_opal_set_lock_state", 8150 "id": 1, 8151 "params": { 8152 "bdev_name": "nvme0n1r1", 8153 "user_id": "1", 8154 "user_password": "********", 8155 "lock_state": "rwlock" 8156 } 8157} 8158~~~ 8159 8160Example response: 8161 8162~~~ 8163{ 8164 "jsonrpc": "2.0", 8165 "id": 1, 8166 "result": true 8167} 8168~~~ 8169 8170# Notifications 8171 8172## notify_get_types {#rpc_notify_get_types} 8173 8174Return list of all supported notification types. 8175 8176### Parameters 8177 8178None 8179 8180### Response 8181 8182The response is an array of strings - supported RPC notification types. 8183 8184### Example 8185 8186Example request: 8187 8188~~~ 8189{ 8190 "jsonrpc": "2.0", 8191 "method": "notify_get_types", 8192 "id": 1 8193} 8194~~~ 8195 8196Example response: 8197 8198~~~ 8199{ 8200 "id": 1, 8201 "result": [ 8202 "bdev_register", 8203 "bdev_unregister" 8204 ], 8205 "jsonrpc": "2.0" 8206} 8207~~~ 8208 8209## notify_get_notifications {#notify_get_notifications} 8210 8211Request notifications. Returns array of notifications that happend since the specified id (or first that is available). 8212 8213Notice: Notifications are kept in circular buffer with limited size. Older notifications might be inaccesible due to being overwritten by new ones. 8214 8215### Parameters 8216 8217Name | Optional | Type | Description 8218----------------------- | -------- | ----------- | ----------- 8219id | Optional | number | First Event ID to fetch (default: first available). 8220max | Optional | number | Maximum number of event to return (default: no limit). 8221 8222### Response 8223 8224Response is an array of event objects. 8225 8226Name | Optional | Type | Description 8227----------------------- | -------- | ----------- | ----------- 8228id | Optional | number | Event ID. 8229type | Optional | number | Type of the event. 8230ctx | Optional | string | Event context. 8231 8232### Example 8233 8234Example request: 8235 8236~~~ 8237{ 8238 "id": 1, 8239 "jsonrpc": "2.0", 8240 "method": "notify_get_notifications", 8241 "params": { 8242 "id": 1, 8243 "max": 10 8244 } 8245} 8246 8247~~~ 8248 8249Example response: 8250 8251~~~ 8252{ 8253 "jsonrpc": "2.0", 8254 "id": 1, 8255 "result": [ 8256 { 8257 "ctx": "Malloc0", 8258 "type": "bdev_register", 8259 "id": 1 8260 }, 8261 { 8262 "ctx": "Malloc2", 8263 "type": "bdev_register", 8264 "id": 2 8265 } 8266 ] 8267} 8268~~~ 8269 8270# Linux Network Block Device (NBD) {#jsonrpc_components_nbd} 8271 8272SPDK supports exporting bdevs through Linux nbd. These devices then appear as standard Linux kernel block devices and can be accessed using standard utilities like fdisk. 8273 8274In order to export a device over nbd, first make sure the Linux kernel nbd driver is loaded by running 'modprobe nbd'. 8275 8276## nbd_start_disk {#rpc_nbd_start_disk} 8277 8278Start to export one SPDK bdev as NBD disk 8279 8280### Parameters 8281 8282Name | Optional | Type | Description 8283----------------------- | -------- | ----------- | ----------- 8284bdev_name | Required | string | Bdev name to export 8285nbd_device | Optional | string | NBD device name to assign 8286 8287### Response 8288 8289Path of exported NBD disk 8290 8291### Example 8292 8293Example request: 8294 8295~~~ 8296{ 8297 "params": { 8298 "nbd_device": "/dev/nbd1", 8299 "bdev_name": "Malloc1" 8300 }, 8301 "jsonrpc": "2.0", 8302 "method": "nbd_start_disk", 8303 "id": 1 8304} 8305~~~ 8306 8307Example response: 8308 8309~~~ 8310{ 8311 "jsonrpc": "2.0", 8312 "id": 1, 8313 "result": "/dev/nbd1" 8314} 8315~~~ 8316 8317## nbd_stop_disk {#rpc_nbd_stop_disk} 8318 8319Stop one NBD disk which is based on SPDK bdev. 8320 8321### Parameters 8322 8323Name | Optional | Type | Description 8324----------------------- | -------- | ----------- | ----------- 8325nbd_device | Required | string | NBD device name to stop 8326 8327### Example 8328 8329Example request: 8330 8331~~~ 8332{ 8333 "params": { 8334 "nbd_device": "/dev/nbd1", 8335 }, 8336 "jsonrpc": "2.0", 8337 "method": "nbd_stop_disk", 8338 "id": 1 8339} 8340~~~ 8341 8342Example response: 8343 8344~~~ 8345{ 8346 "jsonrpc": "2.0", 8347 "id": 1, 8348 "result": "true" 8349} 8350~~~ 8351 8352## nbd_get_disks {#rpc_nbd_get_disks} 8353 8354Display all or specified NBD device list 8355 8356### Parameters 8357 8358Name | Optional | Type | Description 8359----------------------- | -------- | ----------- | ----------- 8360nbd_device | Optional | string | NBD device name to display 8361 8362### Response 8363 8364The response is an array of exported NBD devices and their corresponding SPDK bdev. 8365 8366### Example 8367 8368Example request: 8369 8370~~~ 8371{ 8372 "jsonrpc": "2.0", 8373 "method": "nbd_get_disks", 8374 "id": 1 8375} 8376~~~ 8377 8378Example response: 8379 8380~~~ 8381{ 8382 "jsonrpc": "2.0", 8383 "id": 1, 8384 "result": [ 8385 { 8386 "bdev_name": "Malloc0", 8387 "nbd_device": "/dev/nbd0" 8388 }, 8389 { 8390 "bdev_name": "Malloc1", 8391 "nbd_device": "/dev/nbd1" 8392 } 8393 ] 8394} 8395~~~ 8396 8397# Blobfs {#jsonrpc_components_blobfs} 8398 8399## blobfs_detect {#rpc_blobfs_detect} 8400 8401Detect whether a blobfs exists on bdev. 8402 8403### Parameters 8404 8405Name | Optional | Type | Description 8406----------------------- | -------- | ----------- | ----------- 8407bdev_name | Required | string | Block device name to detect blobfs 8408 8409### Response 8410 8411True if a blobfs exists on the bdev; False otherwise. 8412 8413### Example 8414 8415Example request: 8416 8417~~~ 8418{ 8419 "jsonrpc": "2.0", 8420 "id": 1, 8421 "method": "blobfs_detect", 8422 "params": { 8423 "bdev_name": "Malloc0" 8424 } 8425} 8426~~~ 8427 8428Example response: 8429 8430~~~ 8431{ 8432 "jsonrpc": "2.0", 8433 "id": 1, 8434 "result": "true" 8435} 8436~~~ 8437 8438## blobfs_create {#rpc_blobfs_create} 8439 8440Build blobfs on bdev. 8441 8442### Parameters 8443 8444Name | Optional | Type | Description 8445----------------------- | -------- | ----------- | ----------- 8446bdev_name | Required | string | Block device name to create blobfs 8447cluster_sz | Optional | number | Size of cluster in bytes. Must be multiple of 4KiB page size, default and minimal value is 1M. 8448 8449### Example 8450 8451Example request: 8452 8453~~~ 8454{ 8455 "jsonrpc": "2.0", 8456 "id": 1, 8457 "method": "blobfs_create", 8458 "params": { 8459 "bdev_name": "Malloc0", 8460 "cluster_sz": 1M 8461 } 8462} 8463~~~ 8464 8465Example response: 8466 8467~~~ 8468{ 8469 "jsonrpc": "2.0", 8470 "id": 1, 8471 "result": "true" 8472} 8473~~~ 8474 8475## blobfs_mount {#rpc_blobfs_mount} 8476 8477Mount a blobfs on bdev to one host path through FUSE 8478 8479### Parameters 8480 8481Name | Optional | Type | Description 8482----------------------- | -------- | ----------- | ----------- 8483bdev_name | Required | string | Block device name where the blobfs is 8484mountpoint | Required | string | Mountpoint path in host to mount blobfs 8485 8486### Example 8487 8488Example request: 8489 8490~~~ 8491{ 8492 "jsonrpc": "2.0", 8493 "id": 1, 8494 "method": ""blobfs_mount"", 8495 "params": { 8496 "bdev_name": "Malloc0", 8497 "mountpoint": "/mnt/" 8498 } 8499} 8500~~~ 8501 8502Example response: 8503 8504~~~ 8505{ 8506 "jsonrpc": "2.0", 8507 "id": 1, 8508 "result": "true" 8509} 8510~~~ 8511 8512## blobfs_set_cache_size {#rpc_blobfs_set_cache_size} 8513 8514Set cache pool size for blobfs filesystems. This RPC is only permitted when the cache pool is not already initialized. 8515 8516The cache pool is initialized when the first blobfs filesystem is initialized or loaded. It is freed when the all initialized or loaded filesystems are unloaded. 8517 8518### Parameters 8519 8520Name | Optional | Type | Description 8521----------------------- | -------- | ----------- | ----------- 8522size_in_mb | Required | number | Cache size in megabytes 8523 8524### Response 8525 8526True if cache size is set successfully; False if failed to set. 8527 8528### Example 8529 8530Example request: 8531 8532~~~ 8533{ 8534 "jsonrpc": "2.0", 8535 "id": 1, 8536 "method": "blobfs_set_cache_size", 8537 "params": { 8538 "size_in_mb": 512, 8539 } 8540} 8541~~~ 8542 8543Example response: 8544 8545~~~ 8546{ 8547 "jsonrpc": "2.0", 8548 "id": 1, 8549 "result": true 8550} 8551~~~ 8552 8553# Socket layer {#jsonrpc_components_sock} 8554 8555## sock_impl_get_options {#rpc_sock_impl_get_options} 8556 8557Get parameters for the socket layer implementation. 8558 8559### Parameters 8560 8561Name | Optional | Type | Description 8562----------------------- | -------- | ----------- | ----------- 8563impl_name | Required | string | Name of socket implementation, e.g. posix 8564 8565### Response 8566 8567Response is an object with current socket layer options for requested implementation. 8568 8569### Example 8570 8571Example request: 8572 8573~~~ 8574{ 8575 "jsonrpc": "2.0", 8576 "method": "sock_impl_get_options", 8577 "id": 1, 8578 "params": { 8579 "impl_name": "posix" 8580 } 8581} 8582~~~ 8583 8584Example response: 8585 8586~~~ 8587{ 8588 "jsonrpc": "2.0", 8589 "id": 1, 8590 "result": { 8591 "recv_buf_size": 2097152, 8592 "send_buf_size": 2097152, 8593 "enable_recv_pipe": true, 8594 "enable_zerocopy_send": true, 8595 "enable_quickack": true, 8596 "enable_placement_id": 0, 8597 "enable_zerocopy_send_server": true, 8598 "enable_zerocopy_send_client": false 8599 } 8600} 8601~~~ 8602 8603## sock_impl_set_options {#rpc_sock_impl_set_options} 8604 8605Set parameters for the socket layer implementation. 8606 8607### Parameters 8608 8609Name | Optional | Type | Description 8610--------------------------- | -------- | ----------- | ----------- 8611impl_name | Required | string | Name of socket implementation, e.g. posix 8612recv_buf_size | Optional | number | Size of socket receive buffer in bytes 8613send_buf_size | Optional | number | Size of socket send buffer in bytes 8614enable_recv_pipe | Optional | boolean | Enable or disable receive pipe 8615enable_zerocopy_send | Optional | boolean | Deprecated. Enable or disable zero copy on send for client and server sockets 8616enable_quick_ack | Optional | boolean | Enable or disable quick ACK 8617enable_placement_id | Optional | number | Enable or disable placement_id. 0:disable,1:incoming_napi,2:incoming_cpu 8618enable_zerocopy_send_server | Optional | boolean | Enable or disable zero copy on send for server sockets 8619enable_zerocopy_send_client | Optional | boolean | Enable or disable zero copy on send for client sockets 8620 8621### Response 8622 8623True if socket layer options were set successfully. 8624 8625### Example 8626 8627Example request: 8628 8629~~~ 8630{ 8631 "jsonrpc": "2.0", 8632 "method": "sock_impl_set_options", 8633 "id": 1, 8634 "params": { 8635 "impl_name": "posix", 8636 "recv_buf_size": 2097152, 8637 "send_buf_size": 2097152, 8638 "enable_recv_pipe": false, 8639 "enable_zerocopy_send": true, 8640 "enable_quick_ack": false, 8641 "enable_placement_id": 0, 8642 "enable_zerocopy_send_server": true, 8643 "enable_zerocopy_send_client": false 8644 } 8645} 8646~~~ 8647 8648Example response: 8649 8650~~~ 8651{ 8652 "jsonrpc": "2.0", 8653 "id": 1, 8654 "result": true 8655} 8656~~~ 8657 8658## sock_set_default_impl {#rpc_sock_set_default_impl} 8659 8660Set the default sock implementation. 8661 8662### Parameters 8663 8664Name | Optional | Type | Description 8665----------------------- | -------- | ----------- | ----------- 8666impl_name | Required | string | Name of socket implementation, e.g. posix 8667 8668### Response 8669 8670True if the default socket layer configuration was set successfully. 8671 8672### Example 8673 8674Example request: 8675 8676~~~ 8677{ 8678 "jsonrpc": "2.0", 8679 "method": "sock_set_default_impl", 8680 "id": 1, 8681 "params": { 8682 "impl_name": "posix" 8683 } 8684} 8685~~~ 8686 8687Example response: 8688 8689~~~ 8690{ 8691 "jsonrpc": "2.0", 8692 "id": 1, 8693 "result": true 8694} 8695~~~ 8696 8697# Miscellaneous RPC commands 8698 8699## bdev_nvme_send_cmd {#rpc_bdev_nvme_send_cmd} 8700 8701Send NVMe command directly to NVMe controller or namespace. Parameters and responses encoded by base64 urlsafe need further processing. 8702 8703Notice: bdev_nvme_send_cmd requires user to guarentee the correctness of NVMe command itself, and also optional parameters. Illegal command contents or mismatching buffer size may result in unpredictable behavior. 8704 8705### Parameters 8706 8707Name | Optional | Type | Description 8708----------------------- | -------- | ----------- | ----------- 8709name | Required | string | Name of the operating NVMe controller 8710cmd_type | Required | string | Type of nvme cmd. Valid values are: admin, io 8711data_direction | Required | string | Direction of data transfer. Valid values are: c2h, h2c 8712cmdbuf | Required | string | NVMe command encoded by base64 urlsafe 8713data | Optional | string | Data transferring to controller from host, encoded by base64 urlsafe 8714metadata | Optional | string | Metadata transferring to controller from host, encoded by base64 urlsafe 8715data_len | Optional | number | Data length required to transfer from controller to host 8716metadata_len | Optional | number | Metadata length required to transfer from controller to host 8717timeout_ms | Optional | number | Command execution timeout value, in milliseconds 8718 8719### Response 8720 8721Name | Type | Description 8722----------------------- | ----------- | ----------- 8723cpl | string | NVMe completion queue entry, encoded by base64 urlsafe 8724data | string | Data transferred from controller to host, encoded by base64 urlsafe 8725metadata | string | Metadata transferred from controller to host, encoded by base64 urlsafe 8726 8727### Example 8728 8729Example request: 8730 8731~~~ 8732{ 8733 "jsonrpc": "2.0", 8734 "method": "bdev_nvme_send_cmd", 8735 "id": 1, 8736 "params": { 8737 "name": "Nvme0", 8738 "cmd_type": "admin" 8739 "data_direction": "c2h", 8740 "cmdbuf": "BgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAsGUs9P5_AAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", 8741 "data_len": 60, 8742 } 8743} 8744~~~ 8745 8746Example response: 8747 8748~~~ 8749{ 8750 "jsonrpc": "2.0", 8751 "id": 1, 8752 "result": { 8753 "cpl": "AAAAAAAAAAARAAAAWrmwABAA==", 8754 "data": "sIjg6AAAAACwiODoAAAAALCI4OgAAAAAAAYAAREAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" 8755 } 8756 8757} 8758~~~ 8759 8760## enable_vmd {#rpc_enable_vmd} 8761 8762Enable VMD enumeration. 8763 8764### Parameters 8765 8766This method has no parameters. 8767 8768### Response 8769 8770Completion status of enumeration is returned as a boolean. 8771### Example 8772 8773Example request: 8774 8775~~~ 8776{ 8777 "jsonrpc": "2.0", 8778 "method": "enable_vmd", 8779 "id": 1 8780} 8781~~~ 8782 8783Example response: 8784 8785~~~ 8786{ 8787 "jsonrpc": "2.0", 8788 "id": 1, 8789 "result": true 8790} 8791~~~ 8792 8793## spdk_get_version {#rpc_spdk_get_version} 8794 8795Get the version info of the running SPDK application. 8796 8797### Parameters 8798 8799This method has no parameters. 8800 8801### Response 8802 8803The response is the version number including major version number, minor version number, patch level number and suffix string. 8804 8805### Example 8806 8807Example request: 8808~~ 8809{ 8810 "jsonrpc": "2.0", 8811 "id": 1, 8812 "method": "spdk_get_version" 8813} 8814~~ 8815 8816Example response: 8817~~ 8818{ 8819 "jsonrpc": "2.0", 8820 "id": 1, 8821 "result": { 8822 "version": "19.04-pre", 8823 "fields" : { 8824 "major": 19, 8825 "minor": 4, 8826 "patch": 0, 8827 "suffix": "-pre" 8828 } 8829 } 8830} 8831~~ 8832