Skip to contentSkip to conversation

json conf file syntax

SPDK Jonathan Richardson 1 participant 2 messages Jan 9, 2021 – Jan 11, 2021

lore
Share & tools
lore

Jonathan Richardson

author
#0 lore raw

Hi,

I converted my conf file using config_converter.py but there is no Nvme section in the json file output. It also said the Transport section was invalid so I removed it. When I run nvmf_tgt it says "Unable to listen on transport RDMA. The transport must be created first." Is this related to the json parsing? Are there any json examples or docs that describe the format of the file? Thanks.

root(a)bcm958742k:/usr/share/spdk/scripts# nvmf_tgt  -m 0xf -c temp.json -L
all
Warning: printing stderr to console terminal without -q option specified.
Suggest using --silence-noticelog to disable logging to stderr and
monitor syslog, or redirect stderr to a file.
(Delaying for 10 seconds...)
[2021-01-09 01:58:56.026281] Starting SPDK v21.01-pre git sha1 8bbb8192a /
DPDK 20.11.0 initialization...
[2021-01-09 01:58:56.026341] [ DPDK EAL parameters: [2021-01-09
01:58:56.026355] nvmf [2021-01-09 01:58:56.026367] --no-shconf [2021-01-09
01:58:56.026379] -c 0xf [2021-01-09 01:58:56.026391] --log-level=lib.eal:6
[2021-01-09 01:58:56.026403] --log-level=lib.cryptodev:5 [2021-01-09
01:58:56.026416] --log-level=user1:6 [2021-01-09 01:58:56.026429]
--base-virtaddr=0x200000000000 [2021-01-09 01:58:56.026442]
--match-allocations [2021-01-09 01:58:56.026454] --file-prefix=spdk_pid704
[2021-01-09 01:58:56.026466] ]
EAL: No available hugepages reported in hugepages-32768kB
EAL: No available hugepages reported in hugepages-64kB
EAL: No available hugepages reported in hugepages-1048576kB
EAL: No legacy callbacks, legacy socket not created
[2021-01-09 01:58:56.041236] app.c: 543:spdk_app_start: *NOTICE*: Total
cores available: 4
[2021-01-09 01:58:56.149647] thread.c: 318:spdk_thread_create: *DEBUG*:
Allocating new thread (1, app_thread)
[2021-01-09 01:58:56.279129] reactor.c: 699:reactor_run: *NOTICE*: Reactor
started on core 1
[2021-01-09 01:58:56.279264] reactor.c: 435:get_rusage: *INFO*: Reactor 1:
2 voluntary context switches and 0 involuntary context switches in the
last second.
[2021-01-09 01:58:56.279603] thread.c: 318:spdk_thread_create: *DEBUG*:
Allocating new thread (2, reactor_1)
[2021-01-09 01:58:56.279644] reactor.c: 699:reactor_run: *NOTICE*: Reactor
started on core 2
[2021-01-09 01:58:56.279721] reactor.c: 435:get_rusage: *INFO*: Reactor 2:
2 voluntary context switches and 0 involuntary context switches in the
last second.
[2021-01-09 01:58:56.280002] thread.c: 318:spdk_thread_create: *DEBUG*:
Allocating new thread (3, reactor_2)
[2021-01-09 01:58:56.280038] reactor.c: 699:reactor_run: *NOTICE*: Reactor
started on core 3
[2021-01-09 01:58:56.280185] reactor.c: 435:get_rusage: *INFO*: Reactor 3:
1 voluntary context switches and 1 involuntary context switches in the
last second.
[2021-01-09 01:58:56.280400] thread.c: 318:spdk_thread_create: *DEBUG*:
Allocating new thread (4, reactor_3)
[2021-01-09 01:58:56.280426] reactor.c: 699:reactor_run: *NOTICE*: Reactor
started on core 0
[2021-01-09 01:58:56.280730] reactor.c: 435:get_rusage: *INFO*: Reactor 0:
10 voluntary context switches and 6 involuntary context switches in the
last second.
[2021-01-09 01:58:56.280833] json_config.c:
496:app_json_config_load_subsystem: *DEBUG*: Loading subsystem 'accel'
configuration
[2021-01-09 01:58:56.280843] json_config.c:
359:app_json_config_load_subsystem_config_entry: *DEBUG*: Subsystem
'accel': configuration done.
[2021-01-09 01:58:56.280854] json_config.c:
496:app_json_config_load_subsystem: *DEBUG*: Loading subsystem 'interface'
configuration
[2021-01-09 01:58:56.280863] json_config.c:
359:app_json_config_load_subsystem_config_entry: *DEBUG*: Subsystem
'interface': configuration done.
[2021-01-09 01:58:56.280873] json_config.c:
496:app_json_config_load_subsystem: *DEBUG*: Loading subsystem
'net_framework' configuration
[2021-01-09 01:58:56.280881] json_config.c:
359:app_json_config_load_subsystem_config_entry: *DEBUG*: Subsystem
'net_framework': configuration done.
[2021-01-09 01:58:56.280891] json_config.c:
496:app_json_config_load_subsystem: *DEBUG*: Loading subsystem 'bdev'
configuration
[2021-01-09 01:58:56.280907] json_config.c:
383:app_json_config_load_subsystem_config_entry: *DEBUG*: 	method:
bdev_set_options
[2021-01-09 01:58:56.280916] json_config.c:
392:app_json_config_load_subsystem_config_entry: *DEBUG*: 	params: {
            "bdev_io_pool_size": 65536,
            "bdev_io_cache_size": 256
          }
[2021-01-09 01:58:56.288750] jsonrpc_client.c:  95:jsonrpc_parse_response:
*DEBUG*: JSON string is :
{"jsonrpc":"2.0","id":0,"result":true}

[2021-01-09 01:58:56.288769] json_config.c:
383:app_json_config_load_subsystem_config_entry: *DEBUG*: method:
bdev_nvme_set_options
[2021-01-09 01:58:56.288779] json_config.c:

392:app_json_config_load_subsystem_config_entry: *DEBUG*: 	params: {
            "retry_count": 4,
            "timeout_us": 0,
            "nvme_adminq_poll_period_us": 1000000,
            "action_on_timeout": "none",
            "nvme_ioq_poll_period_us": 0
          }

[2021-01-09 01:58:56.296753] jsonrpc_client.c: 95:jsonrpc_parse_response:
*DEBUG*: JSON string is :
{"jsonrpc":"2.0","id":0,"result":true}

[2021-01-09 01:58:56.296769] json_config.c:
376:app_json_config_load_subsystem_config_entry: *DEBUG*: Method 'bdev_nvme_set_hotplug' not allowed -> skipping [2021-01-09 01:58:56.296780] json_config.c:
359:app_json_config_load_subsystem_config_entry: *DEBUG*: Subsystem 'bdev': configuration done.
[2021-01-09 01:58:56.296791] json_config.c:
496:app_json_config_load_subsystem: *DEBUG*: Loading subsystem 'scsi' configuration
[2021-01-09 01:58:56.296800] json_config.c:
359:app_json_config_load_subsystem_config_entry: *DEBUG*: Subsystem 'scsi': configuration done.
[2021-01-09 01:58:56.296809] json_config.c:
496:app_json_config_load_subsystem: *DEBUG*: Loading subsystem 'nvmf' configuration
[2021-01-09 01:58:56.296820] json_config.c:
383:app_json_config_load_subsystem_config_entry: *DEBUG*: method:
nvmf_set_config
[2021-01-09 01:58:56.296829] json_config.c:

392:app_json_config_load_subsystem_config_entry: *DEBUG*: 	params: {
            "acceptor_poll_rate": 10000
          }

[2021-01-09 01:58:56.644456] jsonrpc_client.c: 95:jsonrpc_parse_response:
*DEBUG*: JSON string is :
{"jsonrpc":"2.0","id":0,"result":true}

[2021-01-09 01:58:56.644472] json_config.c:
383:app_json_config_load_subsystem_config_entry: *DEBUG*: method:
nvmf_set_max_subsystems
[2021-01-09 01:58:56.644482] json_config.c:

392:app_json_config_load_subsystem_config_entry: *DEBUG*: 	params: {
            "max_subsystems": 1024
          }

[2021-01-09 01:58:56.652472] jsonrpc_client.c: 95:jsonrpc_parse_response:
*DEBUG*: JSON string is :
{"jsonrpc":"2.0","id":0,"result":true}

[2021-01-09 01:58:56.652490] json_config.c:
376:app_json_config_load_subsystem_config_entry: *DEBUG*: Method 'nvmf_create_subsystem' not allowed -> skipping
[2021-01-09 01:58:56.652503] json_config.c:
376:app_json_config_load_subsystem_config_entry: *DEBUG*: Method 'nvmf_subsystem_add_listener' not allowed -> skipping [2021-01-09 01:58:56.652515] json_config.c:
376:app_json_config_load_subsystem_config_entry: *DEBUG*: Method 'nvmf_subsystem_add_ns' not allowed -> skipping
[2021-01-09 01:58:56.652525] json_config.c:
359:app_json_config_load_subsystem_config_entry: *DEBUG*: Subsystem 'nvmf': configuration done.
[2021-01-09 01:58:56.652535] json_config.c:
479:app_json_config_load_subsystem: *DEBUG*: No more entries for current state, calling 'framework_start_init'
[2021-01-09 01:58:56.652549] accel_engine.c:
692:spdk_accel_engine_initialize: *NOTICE*: Accel engine initialized to use software engine.
[2021-01-09 01:58:56.652571] thread.c:1376:spdk_io_device_register:
*DEBUG*: Registering io_device sw_accel_engine (0xaaaabaca09c0) on thread app_thread
[2021-01-09 01:58:56.652581] thread.c:1376:spdk_io_device_register:
*DEBUG*: Registering io_device accel_module (0xaaaabaca09b0) on thread app_thread
[2021-01-09 01:58:56.652595] bdev_raid.c: 949:raid_bdev_get_ctx_size:
*DEBUG*: raid_bdev_get_ctx_size
[2021-01-09 01:58:56.705891] thread.c:1376:spdk_io_device_register:
*DEBUG*: Registering io_device bdev_mgr (0xaaaabaca0888) on thread app_thread
[2021-01-09 01:58:56.705935] thread.c:1376:spdk_io_device_register:
*DEBUG*: Registering io_device null_bdev (0xaaaabac9f0b0) on thread app_thread
[2021-01-09 01:58:56.705946] thread.c:1376:spdk_io_device_register:
*DEBUG*: Registering io_device bdev_nvme_poll_groups (0xaaaabac9f280) on thread app_thread
[2021-01-09 01:58:56.705956] thread.c:1376:spdk_io_device_register:
*DEBUG*: Registering io_device aio_module (0xaaaabac9ff80) on thread app_thread
[2021-01-09 01:58:56.705974] thread.c:1376:spdk_io_device_register:
*DEBUG*: Registering io_device nvmf_tgt (0xaaaae428cf50) on thread app_thread
[2021-01-09 01:58:56.706039] thread.c: 318:spdk_thread_create: *DEBUG*:
Allocating new thread (5, nvmf_tgt_poll_group_0)
[2021-01-09 01:58:56.706089] thread.c: 318:spdk_thread_create: *DEBUG*:
Allocating new thread (6, nvmf_tgt_poll_group_1)
[2021-01-09 01:58:56.706107] thread.c:1543:spdk_get_io_channel: *DEBUG*:
Get io_channel 0xffff6c000fe0 for io_device nvmf_tgt (0xaaaae428cf50) on thread nvmf_tgt_poll_group_1 refcnt 1
[2021-01-09 01:58:56.706127] thread.c: 318:spdk_thread_create: *DEBUG*:
Allocating new thread (7, nvmf_tgt_poll_group_2)
[2021-01-09 01:58:56.706146] thread.c:1543:spdk_get_io_channel: *DEBUG*:
Get io_channel 0xffff64000fe0 for io_device nvmf_tgt (0xaaaae428cf50) on thread nvmf_tgt_poll_group_2 refcnt 1
[2021-01-09 01:58:56.706506] thread.c: 318:spdk_thread_create: *DEBUG*:
Allocating new thread (8, nvmf_tgt_poll_group_3)
[2021-01-09 01:58:56.706535] thread.c:1543:spdk_get_io_channel: *DEBUG*:
Get io_channel 0xffff68000fe0 for io_device nvmf_tgt (0xaaaae428cf50) on thread nvmf_tgt_poll_group_3 refcnt 1
[2021-01-09 01:58:56.706571] thread.c:1543:spdk_get_io_channel: *DEBUG*:
Get io_channel 0xaaaae428f290 for io_device nvmf_tgt (0xaaaae428cf50) on thread nvmf_tgt_poll_group_0 refcnt 1
[2021-01-09 01:58:56.706635] json_config.c: 440:subsystem_init_done:
*DEBUG*: 'framework_start_init' done - continuing configuration [2021-01-09 01:58:56.706650] json_config.c:
496:app_json_config_load_subsystem: *DEBUG*: Loading subsystem 'accel' configuration
[2021-01-09 01:58:56.706659] json_config.c:
359:app_json_config_load_subsystem_config_entry: *DEBUG*: Subsystem 'accel': configuration done.
[2021-01-09 01:58:56.706670] json_config.c:
496:app_json_config_load_subsystem: *DEBUG*: Loading subsystem 'interface' configuration
[2021-01-09 01:58:56.706679] json_config.c:
359:app_json_config_load_subsystem_config_entry: *DEBUG*: Subsystem 'interface': configuration done.
[2021-01-09 01:58:57.047572] json_config.c:
496:app_json_config_load_subsystem: *DEBUG*: Loading subsystem 'net_framework' configuration
[2021-01-09 01:58:57.047582] json_config.c:
359:app_json_config_load_subsystem_config_entry: *DEBUG*: Subsystem 'net_framework': configuration done.
[2021-01-09 01:58:57.047602] json_config.c:
496:app_json_config_load_subsystem: *DEBUG*: Loading subsystem 'bdev' configuration
[2021-01-09 01:58:57.047618] json_config.c:
376:app_json_config_load_subsystem_config_entry: *DEBUG*: Method 'bdev_set_options' not allowed -> skipping
[2021-01-09 01:58:57.047633] json_config.c:
383:app_json_config_load_subsystem_config_entry: *DEBUG*: method:
bdev_nvme_set_options
[2021-01-09 01:58:57.047643] json_config.c:

392:app_json_config_load_subsystem_config_entry: *DEBUG*: 	params: {
            "retry_count": 4,
            "timeout_us": 0,
            "nvme_adminq_poll_period_us": 1000000,
            "action_on_timeout": "none",
            "nvme_ioq_poll_period_us": 0
          }

[2021-01-09 01:58:57.055618] jsonrpc_client.c: 95:jsonrpc_parse_response:
*DEBUG*: JSON string is :
{"jsonrpc":"2.0","id":0,"result":true}

[2021-01-09 01:58:57.055636] json_config.c:
383:app_json_config_load_subsystem_config_entry: *DEBUG*: method:
bdev_nvme_set_hotplug
[2021-01-09 01:58:57.055645] json_config.c:

392:app_json_config_load_subsystem_config_entry: *DEBUG*: 	params: {
            "enable": true,
            "period_us": 100000
          }

[2021-01-09 01:58:57.063639] jsonrpc_client.c: 95:jsonrpc_parse_response:
*DEBUG*: JSON string is :
{"jsonrpc":"2.0","id":0,"result":true}

[2021-01-09 01:58:57.063652] json_config.c:
359:app_json_config_load_subsystem_config_entry: *DEBUG*: Subsystem 'bdev': configuration done.
[2021-01-09 01:58:57.063664] json_config.c:
496:app_json_config_load_subsystem: *DEBUG*: Loading subsystem 'scsi' configuration
[2021-01-09 01:58:57.063672] json_config.c:
359:app_json_config_load_subsystem_config_entry: *DEBUG*: Subsystem 'scsi': configuration done.
[2021-01-09 01:58:57.063682] json_config.c:
496:app_json_config_load_subsystem: *DEBUG*: Loading subsystem 'nvmf' configuration
[2021-01-09 01:58:57.063693] json_config.c:
376:app_json_config_load_subsystem_config_entry: *DEBUG*: Method 'nvmf_set_config' not allowed -> skipping
[2021-01-09 01:58:57.063705] json_config.c:
376:app_json_config_load_subsystem_config_entry: *DEBUG*: Method 'nvmf_set_max_subsystems' not allowed -> skipping [2021-01-09 01:58:57.063718] json_config.c:
383:app_json_config_load_subsystem_config_entry: *DEBUG*: method:
nvmf_create_subsystem
[2021-01-09 01:58:57.063728] json_config.c:

392:app_json_config_load_subsystem_config_entry: *DEBUG*: 	params: {
            "nqn": "nqn.2016-06.io.spdk:cnode0",
            "allow_any_host": true,
            "serial_number": "SPDK00000000000001",
            "model_number": "SPDK bdev Controller"
          }

[2021-01-09 01:58:57.071586] jsonrpc_client.c: 95:jsonrpc_parse_response:
*DEBUG*: JSON string is :
{"jsonrpc":"2.0","id":0,"result":true}

[2021-01-09 01:58:57.071602] json_config.c:
383:app_json_config_load_subsystem_config_entry: *DEBUG*: method:
nvmf_subsystem_add_listener
[2021-01-09 01:58:57.071612] json_config.c:

392:app_json_config_load_subsystem_config_entry: *DEBUG*: 	params: {
            "listen_address": {
              "trtype": "RDMA",
              "adrfam": "IPv4",
              "trsvcid": "1023",
              "traddr": "192.168.1.10"
            },
            "nqn": "nqn.2016-06.io.spdk:cnode0"
          }

[2021-01-09 01:58:57.075606] nvmf.c: 613:spdk_nvmf_tgt_listen: *ERROR*:
Unable to listen on transport RDMA. The transport must be created first. [2021-01-09 01:58:57.079610] jsonrpc_client.c: 95:jsonrpc_parse_response:
*DEBUG*: JSON string is :
{"jsonrpc":"2.0","id":0,"error":{"code":-32602,"message":"Invalid parameters"}}

[2021-01-09 01:58:57.079627] json_config.c: 219:rpc_client_poller:
*ERROR*: error response:
{
"code": -32602,
"message": "Invalid parameters"
}
[2021-01-09 01:58:57.079734] json_config.c: 135:app_json_config_load_done:
*DEBUG*: Config load finished with rc -22

author
#1 lore raw

Hi,

I converted my old conf file using config_converter.py but there is no Nvme section in the json file output. When I run nvmf_tgt I get these errors.

[2021-01-11 20:41:39.448690] json_config.c:

392:app_json_config_load_subsystem_config_entry: *DEBUG*: 	params: {
            "allow_duplicated_isid": false,
            "default_time2retain": 20,
            "mutual_chap": false,
            "max_connections_per_session": 2,
            "nop_timeout": 60,
            "disable_chap": false,
            "require_chap": false,
            "node_base": "iqn.2016-06.io.spdk",
            "chap_group": 0,
            "max_sessions": 128,
            "immediate_data": true,
            "error_recovery_level": 0,
            "nop_in_interval": 30,
            "default_time2wait": 2,
            "max_queue_depth": 64,
            "first_burst_length": 8192
          }

[2021-01-11 20:41:39.793791] jsonrpc_client.c: 95:jsonrpc_parse_response:
*DEBUG*: JSON string is :
{"jsonrpc":"2.0","id":0,"error":{"code":-32601,"message":"Method not found"}}

[2021-01-11 20:41:39.793809] json_config.c: 219:rpc_client_poller:
*ERROR*: error response:
{
"code": -32601,
"message": "Method not found"
}
[2021-01-11 20:41:39.794297] json_config.c: 135:app_json_config_load_done:
*DEBUG*: Config load finished with rc -22

Not sure why there is an iscsi_set_options method in my json. This is the nvme section in the conf file:

[Nvme]
TransportId "trtype:PCIe traddr:0007:01:00.0" Nvme0 HotplugEnable Yes
HotplugPollRate 1000000

And my json is below. Is there something missing in it?

{
"subsystems": [

    {
      "subsystem": "accel",
      "config": null
    },
    {
      "subsystem": "interface",
      "config": null
    },
    {
      "subsystem": "net_framework",
      "config": null
    },
    {
      "subsystem": "bdev",
      "config": [
        {
          "params": {
            "bdev_io_pool_size": 65536,
            "bdev_io_cache_size": 256
          },
          "method": "bdev_set_options"
        },
        {
          "params": {
            "retry_count": 4,
            "timeout_us": 0,
            "nvme_adminq_poll_period_us": 1000000,
            "action_on_timeout": "none",
            "nvme_ioq_poll_period_us": 0
          },
          "method": "bdev_nvme_set_options"
        },
        {
          "params": {
            "enable": true,
            "period_us": 100000
          },
          "method": "bdev_nvme_set_hotplug"
        }
      ]
    },
    {
      "subsystem": "scsi",
      "config": null
    },
    {
      "subsystem": "nvmf",
      "config": [
        {
          "params": {
            "acceptor_poll_rate": 10000
          },
          "method": "nvmf_set_config"
        },
        {
          "params": {
            "max_subsystems": 1024
          },
          "method": "nvmf_set_max_subsystems"
        },
        {
          "params": {
            "nqn": "nqn.2016-06.io.spdk:cnode0",
            "allow_any_host": true,
            "serial_number": "SPDK00000000000001",
            "model_number": "SPDK bdev Controller"
          },
          "method": "nvmf_create_subsystem"
        },
        {
          "params": {
            "listen_address": {
              "trtype": "RDMA",
              "adrfam": "IPv4",
              "trsvcid": "1023",
              "traddr": "192.168.1.10"
            },
            "nqn": "nqn.2016-06.io.spdk:cnode0"
          },
          "method": "nvmf_subsystem_add_listener"
        },
        {
          "params": {
            "namespace": {
              "nsid": 1,
              "bdev_name": "Nvme0n1"
            },
            "nqn": "nqn.2016-06.io.spdk:cnode0"
          },
          "method": "nvmf_subsystem_add_ns"
        }
      ]
    },
    {
      "subsystem": "nbd",
      "config": []
    },
    {
      "subsystem": "vhost",
      "config": []
    },
    {
      "subsystem": "iscsi",
      "config": [
        {
          "method": "iscsi_set_options",
          "params": {
            "allow_duplicated_isid": false,
            "default_time2retain": 20,
            "mutual_chap": false,
            "max_connections_per_session": 2,
            "nop_timeout": 60,
            "disable_chap": false,
            "require_chap": false,
            "node_base": "iqn.2016-06.io.spdk",
            "chap_group": 0,
            "max_sessions": 128,
            "immediate_data": true,
            "error_recovery_level": 0,
            "nop_in_interval": 30,
            "default_time2wait": 2,
            "max_queue_depth": 64,
            "first_burst_length": 8192
          }
        }
      ]
    }

]
}