diff --git a/doc/bdev.md b/doc/bdev.md index 605895d359..9cedd53290 100644 --- a/doc/bdev.md +++ b/doc/bdev.md @@ -379,6 +379,26 @@ Example commands `rpc.py construct_lvol_bdev lvol2 25 -u 330a6ab2-f468-11e7-983e-001e67edf35d` +# RAID {#bdev_ug_raid} + +RAID virtual bdev module provides functionality to combine any SPDK bdevs into +one RAID bdev. Currently SPDK supports only RAID 0. RAID functionality does not +store on-disk metadata on the member disks, so user must reconstruct the RAID +volume when restarting application. User may specify member disks to create RAID +volume event if they do not exists yet - as the member disks are registered at +a later time, the RAID module will claim them and will surface the RAID volume +after all of the member disks are available. It is allowed to use disks of +different sizes - the smallest disk size will be the amount of space used on +each member disk. + +Example commands + +`rpc.py construct_raid_bdev -n Raid0 -z 64 -r 0 -b "lvol0 lvol1 lvol2 lvol3"` + +`rpc.py get_raid_bdevs` + +`rpc.py destroy_raid_bdev Raid0` + # Passthru {#bdev_config_passthru} The SPDK Passthru virtual block device module serves as an example of how to write a diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index 902f3e1f0f..0f568ac4c0 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -5018,6 +5018,132 @@ Example response: } ~~~ +# RAID + +## get_raid_bdevs {#rpc_get_raid_bdevs} + +This is used to list all the raid bdev names based on the input category requested. Category should be one +of 'all', 'online', 'configuring' or 'offline'. 'all' means all the raid bdevs whether they are online or +configuring or offline. 'online' is the raid bdev which is registered with bdev layer. 'configuring' is +the raid bdev which does not have full configuration discovered yet. 'offline' is the raid bdev which is +not registered with bdev as of now and it has encountered any error or user has requested to offline +the raid bdev. + +### Parameters + +Name | Optional | Type | Description +----------------------- | -------- | ----------- | ----------- +category | Required | string | all or online or configuring or offline + +### Example + +Example request: + +~~~ +{ + "jsonrpc": "2.0", + "method": "get_raid_bdevs", + "id": 1, + "params": { + "category": "all" + } +} +~~~ + +Example response: + +~~~ +{ + "jsonrpc": "2.0", + "id": 1, + "result": [ + "Raid0" + ] +} +~~~ + +## construct_raid_bdev {#rpc_construct_raid_bdev} + +Constructs new RAID bdev. + +### Parameters + +Name | Optional | Type | Description +----------------------- | -------- | ----------- | ----------- +name | Required | string | RAID bdev name +strip_size_kb | Required | number | Strip size in KB +raid_level | Required | number | RAID level +base_bdevs | Required | string | Base bdevs name, whitespace separated list in quotes + + +### Example + +Example request: + +~~~ +{ + "jsonrpc": "2.0", + "method": "construct_raid_bdev", + "id": 1, + "params": { + "name": "Raid0", + "raid_level": 0, + "base_bdevs": [ + "Malloc0", + "Malloc1", + "Malloc2", + "Malloc3" + ], + "strip_size": 4096 + } +} +~~~ + +Example response: + +~~~ +{ + "jsonrpc": "2.0", + "id": 1, + "result": true +} +~~~ + +## destroy_raid_bdev {#rpc_destroy_raid_bdev} + +Removes RAID bdev. + +### Parameters + +Name | Optional | Type | Description +----------------------- | -------- | ----------- | ----------- +name | Required | string | RAID bdev name + +### Example + +Example request: + +~~~ +{ + "jsonrpc": "2.0", + "method": "destroy_raid_bdev", + "id": 1, + "params": { + "name": "Raid0" + } +} +~~~ + +Example response: + +~~~ +{ + "jsonrpc": "2.0", + "id": 1, + "result": true +} +~~~ + # Notifications ## get_notification_types {#rpc_get_notification_types}