Commit 4227aeb7 authored by Maciej Szwed's avatar Maciej Szwed Committed by Jim Harris
Browse files

doc/raid: Documentation for RAID bdev



Signed-off-by: default avatarMaciej Szwed <maciej.szwed@intel.com>
Change-Id: If3d7cd1693b5b2191045553dcd50bb6fd5c98d98

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455239


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 59a1fbe9
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -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
+126 −0
Original line number Diff line number Diff line
@@ -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}