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