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